Windows 11 Pro: Secure authorization and enforcement for a local Python assistant

אסף מנגוני 0 Reputation points
2026-11-16T08:54:22.5166667+00:00

Hello Microsoft Community,

We are designing a local Python-based assistant that runs on Windows 11 Pro.

The assistant must operate under strict security restrictions. We are evaluating how to enforce authorization at the Windows operating system level, rather than relying only on application-level permission checks.

Our proposed architecture includes:

  1. A dedicated non-administrator Windows account or restricted service identity.
  2. NTFS permissions that restrict access to approved directories.
  3. Read-only access to designated input folders and write access to a single output directory.
  4. A separate authorization component that validates owner approval before sensitive operations.
  5. Windows-enforced restrictions that remain effective even if the Python application is compromised.

We would appreciate clarification on the following:

  1. What is the recommended Windows 11 Pro architecture for enforcing these restrictions on a local Python process?
  2. Can a standard user process be reliably restricted using NTFS ACLs, restricted tokens, and Windows service isolation?
  3. Which Windows mechanisms can prevent a compromised Python process from bypassing application-level authorization decisions?
  4. What are the practical limitations of AppLocker, WDAC/App Control for Business, and service isolation on Windows 11 Pro?
  5. How should an authorization broker be isolated from the assistant process to prevent unauthorized access or privilege escalation?

We are looking for a supported, documented Windows security architecture, including any relevant Microsoft documentation.

This is a design review only. No privileged execution or deployment has been authorized.

Thank you.Hello Microsoft Community,

We are designing a local Python-based assistant that runs on Windows 11 Pro.

The assistant must operate under strict security restrictions. We are evaluating how to enforce authorization at the Windows operating system level, rather than relying only on application-level permission checks.

Our proposed architecture includes:

  1. A dedicated non-administrator Windows account or restricted service identity.
  2. NTFS permissions that restrict access to approved directories.
  3. Read-only access to designated input folders and write access to a single output directory.
  4. A separate authorization component that validates owner approval before sensitive operations.
  5. Windows-enforced restrictions that remain effective even if the Python application is compromised.

We would appreciate clarification on the following:

  1. What is the recommended Windows 11 Pro architecture for enforcing these restrictions on a local Python process?
  2. Can a standard user process be reliably restricted using NTFS ACLs, restricted tokens, and Windows service isolation?
  3. Which Windows mechanisms can prevent a compromised Python process from bypassing application-level authorization decisions?
  4. What are the practical limitations of AppLocker, WDAC/App Control for Business, and service isolation on Windows 11 Pro?
  5. How should an authorization broker be isolated from the assistant process to prevent unauthorized access or privilege escalation?

We are looking for a supported, documented Windows security architecture, including any relevant Microsoft documentation.

This is a design review only. No privileged execution or deployment has been authorized.

Thank you.

Windows for home | Windows 11 | Security and privacy

1 answer

Sort by: Most helpful
  1. AI answer

    2026-11-16T08:57:42.38+00:00

    A strong documented Windows 11 Pro design is to run the Python assistant in an LPAC/AppContainer with explicit NTFS grants, while a separately secured least-privilege service performs only narrowly defined operations after independently authenticating both the caller and owner approval.

    1. Untrusted assistant process
      • Use a dedicated standard account with no administrator membership or powerful user rights.
      • Launch Python under a Less Privileged AppContainer (LPAC) where compatibility permits. An AppContainer has its own package SID, runs at Low Integrity, and receives only the intersection of permissions granted to the user and AppContainer identities. LPAC is stricter than a regular AppContainer and requires explicit capabilities for resources such as registry and COM access.^1^
      • Grant the AppContainer SID:
        • Read/execute on the fixed Python runtime and approved modules.
        • Read-only access to input directories.
        • Create/write access only to the output directory.
        • No network capability unless required.
      • Keep the runtime, launcher, broker binaries, configuration, and authorization state in administrator-owned, non-user-writable locations.
      Regular AppContainers retain access to certain common system files, registry locations, and COM objects; LPAC should therefore be preferred when CPython and its dependencies work under it.^1^
    2. Native launcher
      • A small native launcher creates the AppContainer profile, constructs the capability list, and starts python.exe using STARTUPINFOEX, PROC_THREAD_ATTRIBUTE_SECURITY_CAPABILITIES, and EXTENDED_STARTUPINFO_PRESENT.^1^
      • Do not inherit broker handles, tokens, pipe handles, or privileged environment secrets.
      • Add a restricted token to remove unused privileges and apply restricting SIDs. Windows performs both the normal SID access check and the restricting-SID check; both must permit access.^2^
      • If the assistant has a UI, do not place a merely restricted-token process on the same desktop as unrestricted applications; Microsoft documents a window-message attack risk in that configuration.^2^

    Illustrative launch fragment only—the complete launcher must also create/derive the profile SID, initialize and free the attribute list, handle errors, close handles, and construct a writable command line:

    SECURITY_CAPABILITIES caps{};
    caps.AppContainerSid = packageSid;
    caps.Capabilities = capabilityList;
    caps.CapabilityCount = capabilityCount;
    
    UpdateProcThreadAttribute(
        attributes, 0,
        PROC_THREAD_ATTRIBUTE_SECURITY_CAPABILITIES,
        &caps, sizeof(caps), nullptr, nullptr);
    
    STARTUPINFOEXW si{};
    si.StartupInfo.cb = sizeof(si);
    si.lpAttributeList = attributes;
    
    CreateProcessW(nullptr, commandLine, nullptr, nullptr, FALSE,
        EXTENDED_STARTUPINFO_PRESENT, environment, workDir,
        &si.StartupInfo, &processInfo);
    
    1. Authorization broker
      • Run the broker as a separate Windows service under a dedicated low-privilege account—not LocalSystem and preferably not a shared NetworkService identity.
      • Enable its per-service SID and ACL each protected object to that SID. Configure only required service privileges; the Service Control Manager can remove privileges not listed as required.^3^
      • Expose operations, not arbitrary primitives: for example, PublishApprovedResult(id) rather than “write any path” or “execute this command.”
      • Canonicalize and validate every path and parameter inside the broker. Never trust authorization conclusions supplied by Python.

    Service isolation is defense in depth, not a security boundary, so it cannot compensate for a broker that accepts arbitrary paths, commands, handles, or impersonation requests.^4^

    Broker IPC and owner approval

    Use a local named pipe with all of these controls:

    • Supply an explicit pipe security descriptor; never accept the default DACL, which grants read access to Everyone and anonymous users.^5^
    • Grant the assistant only the individual data-transfer rights it needs. Do not grant FILE_GENERIC_WRITE or CreateNewInstance: generic write includes FILE_CREATE_PIPE_INSTANCE, allowing an untrusted process to create another server instance and accept clients.^5^
    • Authenticate the connected assistant token by impersonating the pipe client, opening its thread token, checking the expected account/AppContainer identity, and immediately calling RevertToSelf. Windows supports performing an AccessCheck against the impersonated client token.^6^
    • Cryptographically authenticate the broker endpoint as well. A pipe owner check alone cannot detect a malicious additional pipe instance; Microsoft recommends authenticating the channel, such as with a certificate or a secret available only to the genuine server.^7^

    Collect approval through a separate trusted UI process, not an assistant-rendered dialog. The UI should authenticate to the broker independently and approve a broker-generated challenge containing the exact operation, target, digest, expiration, and one-time nonce. The broker must reject altered, expired, or replayed approvals. Windows “Require trusted path for credential entry” protects Windows credential prompts only; it does not make a custom consent button trustworthy.

    ACL and ownership details

    NTFS ACLs reliably constrain the assistant while it remains non-administrative and lacks ownership or takeover privileges. Do not make it owner of protected inputs, runtime files, policy, or broker resources: an object owner implicitly has WRITE_DAC and can change its DACL.^8^

    Files the assistant creates in its output directory will ordinarily be owned by its token. If generated files require immutable ACLs, have the broker create them and return a constrained handle, or have the broker move/copy validated output into an administrator-owned destination.

    App Control and AppLocker limitations

    • App Control for Business (WDAC): available on Windows 11 client editions and applies device-wide. It provides stronger application control than AppLocker.^9^
    • However, many third-party Python engines are not App Control-enlightened. Allowing such a Python interpreter implicitly allows scripts executed through it; App Control remains useful for controlling the interpreter, native extensions, DLLs, drivers, and helper executables, but not Python-level authorization.^10^
    • AppLocker: Windows 11 Pro can configure and enforce it; Windows 11 no longer requires a particular edition for enforcement.^11^ It is defense in depth rather than a defensible security boundary.^12^
    • Never allow execution by path from a directory writable by the assistant. Prefer publisher or hash rules for immutable binaries. Test App Control/AppLocker in audit mode, including Python updates, native modules, repair, and rollback, before enforcement.

    Validation gates before deployment

    Verify that the assistant cannot:

    1. Read or modify files outside the approved roots.
    2. change ACLs or ownership of protected objects;
    3. access the network without an explicit capability;
    4. open broker configuration, approval secrets, or privileged handles;
    5. create an alternate pipe server or call unauthorized broker methods;
    6. reuse approval messages or substitute paths after approval;
    7. launch unapproved helper binaries or load unapproved native modules.

    These controls do not protect against a compromised administrator or kernel, a vulnerable privileged broker, or confused-deputy defects in broker request validation. CPython compatibility under LPAC/AppContainer must also be prototyped because packaging, module loading, temporary directories, registry use, and subprocess behavior may require application changes.


    References

    1. Launch an AppContainer
    2. Restricted Tokens
    3. Service Changes for Windows Vista
    4. Microsoft Security Advisory 2264072
    5. Named Pipe Security and Access Rights
    6. Verifying Client Access with ACLs in C++
    7. Inter-process communication with gRPC and Named pipes
    8. Owner of a New Object
    9. App Control for Business and AppLocker Overview
    10. Script enforcement with App Control for Business
    11. Requirements to use AppLocker
    12. AppLocker
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.