Skip to content

[Spec]: Update sandbox configuration schema to allow services enumeration - #1882

Open
Vsevolod (beervoley) wants to merge 9 commits into
mainfrom
user/vsiliush/spec-services-enumeration
Open

Vsevolod (beervoley) wants to merge 9 commits into
mainfrom
user/vsiliush/spec-services-enumeration

Conversation

@beervoley

@beervoley Vsevolod (beervoley) commented Dec 1, 2026 •

Copy link
Copy Markdown

Description

Adds the proposed design for explicit opt-in Windows ProcessContainer service enumeration through processContainer.services.enumerateVisible in the development contract (1.1.0-alpha).

The spec is at docs/development/architecture/designs/1900-services-enumeration/README.md.

  • Only explicit enumerateVisible: true adds permission. Omitted, empty, and false policies add none.
  • Any present services section, including {}, requires native Windows ProcessContainer and PSEC 1.3; unsupported hosts/backends reject it.
  • Published contracts and typed V1 SDK requests retain their existing PSEC version-selection rules and receive no implicit grant.
  • Existing V1.Dev JSON APIs can carry development-contract services without new signatures; nonempty-observation preparation preserves services presence/value and prospective PSEC. Empty-observation preparation returns valid, authorized JSON unchanged without establishing host compatibility.
  • Request-aware probes check PSEC 1.3 through the shared launch-eligibility decision. The version guarantee is limited to explicit services; bare probes report generic availability and launch still validates its selected PSEC version.
  • Direct native in-process PTY remains unsupported. Node V1.Dev already supports executor-backed ConPTY; policy refusal appears in terminal output and exit status after executor startup. Policy hashes represent explicit request intent, without a host-resolved default.
  • Backend delivery requires real-host PSEC 1.3 enforcement, older-host version rejection, and injected creation-refusal coverage. Management-denial checks require successful unsandboxed BITS/SCM access controls and sandbox ERROR_ACCESS_DENIED, without service mutation. Real feature-disabled coverage is explicitly unverified until the OS team supplies a build/image or supported provisioning procedure; a skip is not passing evidence.

This PR is documentation-only and does not change public SDK signatures. The proposal remains pending maintainer acceptance and design approval; implementation PR #1868 must not merge before this spec is approved and merged.

References

Refs #1900
Implementation: #1868

Validation

Documentation-only changes; reviewed for consistency with the opt-in behavior and review comments.

Checklist

  • Signed the Contributor License Agreement
  • Linked to an issue
  • Issue has maintainer-applied feature-accepted
  • Tracking issue remains open for implementation and validation
  • Updated the design and validation plan
  • Maintainers have approved the spec before merge

Issue Type

Feature

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 843b1137-3895-473e-b922-4b0b56eb9ad9
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 843b1137-3895-473e-b922-4b0b56eb9ad9
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 843b1137-3895-473e-b922-4b0b56eb9ad9
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 843b1137-3895-473e-b922-4b0b56eb9ad9
@beervoley
Vsevolod (beervoley) requested a review from a team December 1, 2026 22:40
@beervoley
Vsevolod (beervoley) requested a review from a team as a code owner December 1, 2026 22:40
Copilot AI balanced review requested due to automatic review settings December 1, 2026 22:40
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The specification has conflicting enumeration defaults and PSEC compatibility guarantees, promises unsupported PTY behavior, and leaves host-resolved audit hashing and required Windows test gates unresolved.

5 open issues
What changed in this PR

Adds a proposed design for Windows service enumeration in MXC’s native ProcessContainer backend. This is a specification-only change; it does not implement the feature or change published SDK APIs.

Changes:

  • Proposes processContainer.services.enumerateVisible in the development contract, mapped to Windows PSEC 1.3.
  • Defines host-dependent defaults, backend restrictions, compatibility expectations, and security behavior.
  • Outlines acceptance criteria, Windows validation, and delivery milestones.
File Description
docs/​development/​architecture/​designs/​1868-services-enumeration/​README.md Adds the service-enumeration design, compatibility rules, and validation plan.

Review effort: Balanced

@beervoley Vsevolod (beervoley) changed the title User/vsiliush/spec services enumeration [Spec]: Update sandbox configuration schema to allow services enumeration Dec 1, 2026
Address spec review feedback on defaults, PSEC compatibility, PTY support, policy identity, and functional validation gates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2681ffd7-9999-40c1-b6bc-6d1b7f87bc3c

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The spec requires a nonexistent ProcessContainer fallback and misstates V1.Dev compatibility, with missing validation for services preservation and prospective PSEC reproduction.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Low severity Account for V1.Dev services in compatibility and validation claims

docs/​development/​architecture/​designs/​1868-services-enumeration/​README.md:108

[P2] The public V1.Dev JSON APIs already accept development-contract requests, so callers can express services without contract promotion (see docs/api-reference/{rust,dotnet,node}/v1/dev.md). Distinguish those callers from unchanged typed V1 inputs here and in the other compatibility claims, including lines 62–65 and 165–166. Include V1.Dev execution and policy preparation in validation, checking that preparation preserves services values and section presence and reproduces the prospective PSEC.

5 resolved since last review

Review effort: Balanced

Refs #1900. Preserve the design approval gate and name the spec folder for its tracking issue.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2681ffd7-9999-40c1-b6bc-6d1b7f87bc3c
Copilot AI balanced review requested due to automatic review settings December 2, 2026 20:57
@beervoley

Copy link
Copy Markdown
Author

Addressed the five review comments in e189b39 and 0f16097: service enumeration is now explicitly opt-in (including empty-object behavior); published callers retain existing PSEC version selection; PTY is unsupported; policy identity no longer depends on a host-resolved default; and functional Windows coverage is part of backend delivery rather than a follow-up. Created tracking issue #1900 and renamed the spec folder accordingly. Maintainer acceptance and design approval remain pending.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the opt-in Windows service enumeration design specification.

1 open issue

Review effort: Balanced

@bbonaby Branden Bonaby (bbonaby) added the Feature-Spec-In-Review Label for feature spec PRs that are currently in review label Dec 2, 2026
Refs #1900. Mark AppContainer fallback not applicable and specify native PSEC availability and version rejection instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2681ffd7-9999-40c1-b6bc-6d1b7f87bc3c
Copilot AI balanced review requested due to automatic review settings December 2, 2026 22:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation misleadingly implies probing detects unsupported PSEC 1.3, although the unchanged probe does not validate the requested version and rejection occurs at launch.

1 open issue
1 resolved since last review

Review effort: Balanced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2681ffd7-9999-40c1-b6bc-6d1b7f87bc3c
Copilot AI balanced review requested due to automatic review settings December 3, 2026 00:05
@beervoley

Copy link
Copy Markdown
Author

Also addressed the previously missed V1.Dev finding from review 6158786872 in cc61587. The compatibility, non-goals, API, acceptance, and delivery sections now distinguish unchanged typed V1 inputs from existing Rust/.NET/Node V1.Dev JSON APIs, with links to all three references; no SDK signature change or contract promotion is needed to submit development services. The validation plan now explicitly includes Dev execution and nonempty-observation preparation. Implementation commit 479f3f9 exercises public Rust Dev preparation removing registryRead, preserves omission/empty/false/true distinctly, compares the resulting PSEC with native submission and backend execution, and verifies unsupported requests do not create or launch. Maintainer acceptance/design approval and the PSEC 1.3-enabled/feature-disabled host results remain outstanding.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the documentation-only proposal for opt-in Windows service enumeration.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@beervoley

Copy link
Copy Markdown
Author

Gudge (@MGudgin) - can you have a look please? :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@MGudgin Gudge (MGudgin) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Requesting revisions to the proposed validation plan and the policy-preparation semantics. Findings 1-6 are posted inline; the claim-only corrections in 3 and 5 are nonblocking by themselves.

Verified against head cc615879081f72b086d2cca93cd623d8849a393b and PR merge-base dcb23e53344faf882560d3751dc6bd8a936e1e44.

Verified scope

The diff adds only the 263-line design document: no implementation, public SDK signature, released schema, or existing CI gate is modified. Runtime implementation and successful PSEC 1.3 host validation remain later delivery work; neither was required or claimed as completed in this review.

Findings outside the diff

None. All six comments anchor to added specification lines.

Verified pre-existing - not attributed to this PR

The supporting Node PTY route, empty-observation preparation no-op, baseline probe/version-query split, and existing cleanup/test harness are byte-identical between merge-base and head. They are context, not old-code defects or independent merge conditions. In particular, Node's PTY route is documented in docs/api-reference/node/v1/dev.md:70-76, and the preparation exception is explicit in docs/development/architecture/designs/1634-creation-policy-correction/README.md:109-114. The requested changes concern this proposal's new claims, interactions, and validation criteria.

the same PR that delivers backend behavior.
- **Required host matrix:** a PSEC 1.3-enabled Windows host for positive and
negative enforcement; an older host for explicit-policy rejection; and a
host with the OS enumeration feature disabled for creation-failure coverage.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium (testability / test coverage) - 1. Separate real-host coverage from injected refusal coverage.

Attribution: introduced_by_change - the new required matrix promises a feature-disabled host without establishing how that state can be provisioned.

The PSEC 1.3 build/CI host is still an open question, and the spec does not identify a supported way to obtain the OS-feature-disabled state. We should not assume a feature toggle exists or require one machine to support all three states. Generic base-container availability also does not establish those states.

Requested change: distinguish the required real-host enforcement run, older-host version rejection, and injected creation-refusal tests. State how any real feature-disabled scenario would be provisioned, or explicitly record it as unverified until the OS team supplies that mechanism. Keep required execution distinct from a successful skip. This asks for a feasible coverage plan, not three already-configured CI cells or completed implementation tests.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in b44347f. The plan now separates required real-host PSEC 1.3 enforcement, older-host version rejection, and injected creation-refusal coverage. It explicitly requires recorded build/version-query/enforcement results, allows separate hosts or images, and does not infer a feature toggle from generic availability. Real feature-disabled coverage is marked unverified until the OS team provides a specific build/image or supported configuration procedure. Missing prerequisites and skips cannot satisfy required execution.

- Request-aware probes reject unsupported services without creation or
workload execution, while host-only probes retain generic availability.
A successful request-aware probe does not promise creation succeeds when
the OS feature is disabled.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium (reliability / testability) - 2. Distinguish creation refusal from version rejection.

Attribution: introduced_by_change - the proposal adds a creation-time refusal case but does not state an assertion proving that creation was reached.

A failed launch with no workload execution also occurs when an older host rejects PSEC 1.3 before CreateProcessSecurityEnvironment. That result alone does not cover the separate Windows creation-refusal path described here.

Requested change: add a planned injected regression where the version query accepts 1.3, creation receives the services policy and returns a failure, and MXC propagates it without launching work or retrying with the policy removed. Existing src/mxc-sdk/src/backends/process_container/common/policy_preparation_backend_tests.rs:78-120 exercises injected creation HRESULTs through public spawn_json, so this does not require a feature-disabled physical host. This is a coverage assertion, not a claim that the current implementation downgrades policy.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in b44347f with a distinct planned injected creation-refusal regression: accept PSEC 1.3 in the version query, capture the unchanged services policy in the PSEC received by CreateProcessSecurityEnvironment, return a known failing HRESULT, and assert exactly one creation call, propagated HRESULT/operation context, no workload, and no retry with services removed or disabled. The spec explicitly distinguishes this MXC error-propagation test from older-host rejection and from real feature-disabled OS enforcement.

| --- | --- |
| Run-to-completion, buffered output | Yes |
| Live stdio streaming | Yes (policy is independent of stdio) |
| Interactive PTY | Unsupported by ProcessContainer; unchanged by this feature |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium (correctness) - 3. Account for Node's existing executor-backed PTY route.

Attribution: claim_mismatch - the new blanket PTY exclusion conflicts with an existing supported SDK route; this is nonblocking by itself.

Direct native ProcessContainer PTY is unsupported, but Node V1.Dev spawnWithPtyJson forwards ProcessContainer JSON to wxc-exec under ConPTY (sdk/node/src/v1/dev/index.ts:235-251; sdk/node/src/bindings/process-container-pty.ts:140-176,229-236). That route can carry the new field once shared parsing and creation support it, without a new API.

Requested change: distinguish native in-process PTY from Node's executor-backed mode and include services enforcement on the latter. Preserve its documented failure contract: the promise resolves at executor startup, while later policy refusal appears in terminal output and exit status (docs/api-reference/node/v1/dev.md:70-76). This does not ask to add PTY support.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in b44347f. The execution table now distinguishes unsupported direct native in-process PTY from the existing Node V1.Dev spawnWithPtyJson -> wxc-exec/ConPTY route. The spec preserves resolution at executor startup and later policy refusal via combined terminal output/nonzero exit, not Promise rejection. The validation plan includes services enforcement on this route and an older-host refusal case with an absent workload sentinel; it does not add PTY support.

- **Compatibility:** No change for published-contract requests, typed V1
callers, or development-contract JSON requests that omit `services`.
Development JSON requests with an explicit services section require PSEC
1.3 through every existing V1.Dev API as well as the CLI. Host upgrades do

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium (correctness) - 4. Preserve empty-observation preparation as a no-op.

Attribution: newly_exposed_by_change - the new services host requirement is stated for every V1.Dev API without preserving the existing preparation exception.

With empty observations, preparation returns valid, authorized request JSON unchanged and skips backend serviceability (src/mxc-sdk/src/core/mxc_engine/policy_preparation.rs:34-55). The accepted preparation design explicitly says this is not validation or approval (docs/development/architecture/designs/1634-creation-policy-correction/README.md:109-114). After services JSON is accepted, that no-op can therefore return a services request on an older host even though execution correctly rejects it.

Requested change: state that empty-observation preparation preserves the JSON, including services, without providing a host-compatibility result. Scope candidate compatibility checks to nonempty-observation preparation; execution still checks launch eligibility. Add the empty-observation regression alongside the proposed nonempty case.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in b44347f. Empty observations are now explicitly a no-op after contract/phase/authorization checks: JSON remains byte-for-byte unchanged, including services, without backend serviceability checks or host approval. Candidate compatibility checks are scoped to nonempty observations, and execution always rechecks eligibility. Added planned empty-observation regressions for all four services shapes with missing/pre-1.3/1.3 version-query configurations, followed by execution rejection where appropriate; linked the accepted preparation design.

executing the workload. Bare `--probe` checks generic availability, not
compatibility with a services request; its output can still report
`base-container` on a pre-1.3 host.
- A successful request-aware probe establishes version compatibility, not OS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium (correctness) - 5. Bound the probe's version-compatibility guarantee.

Attribution: claim_mismatch - the new general guarantee exceeds the existing probe behavior if the proposed version query is added only for present services sections; this is nonblocking by itself.

For requests omitting services, the current shared decision checks native API availability, while launch separately queries the selected PSEC version (src/mxc-sdk/src/backends/process_container/common/base_container_runner.rs:489-529,634-647,673). The probe explicitly disclaims launch-time PSEC version validation (src/mxc-sdk/src/backends/process_container/common/probe.rs:99-104). Adding only a services-specific 1.3 check does not establish version compatibility for every supplied configuration.

Requested change: either narrow this sentence to compatibility with an explicit services section, or explicitly specify and test a shared selected-version check for all request-aware probes. Keep bare probing unchanged. The existing split is context; the attributable issue is the new guarantee.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in b44347f by narrowing the guarantee, not broadening runtime probing. Success for a request with an explicit services section establishes support for that section's PSEC 1.3 requirement only. The spec now states that requests omitting services keep existing probe behavior and launch separately validates the selected PSEC version. Bare probing remains generic and unchanged.

- **Proposed functional tests (Windows CI, PSEC 1.3 host):** run a command with
`enumerateVisible` true, false, omitted, and an empty services object, and
assert service listing succeeds only for explicit true. Check published
requests remain non-granting and service-management access is denied even

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Medium (testability / test coverage) - 6. Give management denial a discriminating baseline.

Attribution: introduced_by_change - the new functional acceptance criterion specifies denial without a concrete valid operation or expected error.

An arbitrary nonzero exit could mean missing tooling, a nonexistent service, or a service ACL that already denies the test identity. Such a result does not establish that the new enumeration permission remains separate from management access.

Requested change: name a management operation or access check on a known service, establish that it is available and permitted for the unsandboxed test identity, then assert the expected access-denied result in the enumeration-enabled sandbox. The spec needs that test oracle, not a complete service-fixture implementation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in b44347f with a concrete, non-mutating oracle: require installed BITS and successful unsandboxed OpenSCManagerW(SC_MANAGER_CREATE_SERVICE) plus OpenServiceW(BITS) with SERVICE_CHANGE_CONFIG/START/STOP for the same elevated test identity. Close handles without changing services. In the enumeration-enabled sandbox, require enumeration success and management ERROR_ACCESS_DENIED (5), including a denied SCM connection as the prerequisite denial for dependent service opens. Missing service/tooling, unrelated errors, or a failed host positive control do not count as passing denial coverage.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs-Author-Feedback Waiting for additional information or action from the issue or pull-request author. label Dec 4, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2681ffd7-9999-40c1-b6bc-6d1b7f87bc3c
Copilot AI balanced review requested due to automatic review settings December 4, 2026 19:08
@microsoft-github-policy-service microsoft-github-policy-service Bot added Needs-Attention Requires attention or a decision from the MXC maintainers. and removed Needs-Author-Feedback Waiting for additional information or action from the issue or pull-request author. labels Dec 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The security-sensitive token-permission design still requires maintainer and OS-team confirmation of PSEC 1.3 enforcement semantics, supported Windows builds, and CI provisioning to validate feature-disabled behavior.

No open issues 🎉

Review effort: Balanced

@MGudgin Gudge (MGudgin) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the updated specification at b44347f against all six findings from my previous review. All six are addressed: the coverage plan separates real-host enforcement from injected refusal testing, the failure assertions are explicit, and the existing PTY, empty-observation preparation, and probe semantics are preserved. No remaining blocker from that review. This is specification approval; implementation and PSEC 1.3 host validation remain delivery requirements.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature-Spec-In-Review Label for feature spec PRs that are currently in review Needs-Attention Requires attention or a decision from the MXC maintainers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants