Skip to content

Managed rollouts: ACP_REQUIRE_ENROLLMENT blocks unenrolled machines instead of warning - #23

Merged
davidcrowe merged 1 commit into
mainfrom
managed-mode
Sep 3, 2026
Merged

Managed rollouts: ACP_REQUIRE_ENROLLMENT blocks unenrolled machines instead of warning#23
davidcrowe merged 1 commit into
mainfrom
managed-mode

Conversation

@davidcrowe

Copy link
Copy Markdown
Collaborator

What

Adds one env flag, ACP_REQUIRE_ENROLLMENT=1, for admin-pushed hook rollouts (Codex requirements.toml, Claude Code managed settings, Cursor enterprise hooks.json).

With the flag set and no credential at ~/.acp/credentials / ~/.acp/proxy-key / ACP_BEARER_TOKEN:

  • PreToolUsepermissionDecision: "deny" with the enrollment step (authorize page + one-line write of the key).
  • Other events → systemMessage only.
  • ~/.acp/lapse.log gets a BLOCKED\tno-credentials line (was UNGOVERNED).
  • LOCAL mode (ACP_LOCAL=1 or a policy.json) does not satisfy the gate: managed means the workspace policy.

Without the flag, behaviour is byte-identical to today (run ungoverned, warn once per session, log a lapse).

Why

A managed hook is the same file on every machine and can't carry a per-user key. Today an unenrolled seat runs ungoverned with a warning, which is the right default for self-serve installs and the wrong one for a fleet an admin believes is covered. The flag is the admin's explicit opt-in. Gateway-unreachable posture (#385) is deliberately untouched: this gate is about no credential, not no gateway.

Tests

New test/managed-mode.test.mjs (6 cases: default posture unchanged, deny on PreToolUse, deny on every call, LOCAL doesn't satisfy, non-Pre events message-only, 0/unset = default). node --test: 111 pass, 0 fail.

Docs: per-harness recipes land on agenticcontrolplane.com/docs/enterprise (separate PR). Scoped in davidcrowe/gatewaystack-connect#943.

…nstead of warning

An admin who pushes the hook fleet-wide (Codex requirements.toml, Claude Code
managed settings, Cursor enterprise hooks) sets ACP_REQUIRE_ENROLLMENT=1 in
the managed hook command or managed env. With no workspace credential present
the hook now denies each PreToolUse call with the enrollment step, writes a
BLOCKED lapse line, and refuses to fall back to LOCAL mode. Without the flag
nothing changes: the default posture is still run-ungoverned-and-warn.

Gateway-unreachable posture (#385) is untouched.
@davidcrowe
davidcrowe merged commit ce3ae07 into main Sep 3, 2026
2 checks passed
@davidcrowe
davidcrowe deleted the managed-mode branch September 3, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant