Skip to content

fix(security): harden the subagent enforcement bypass#154

Open
manzil-infinity180 wants to merge 3 commits into
devfrom
fix/subagent-bypass-100
Open

fix(security): harden the subagent enforcement bypass#154
manzil-infinity180 wants to merge 3 commits into
devfrom
fix/subagent-bypass-100

Conversation

@manzil-infinity180
Copy link
Copy Markdown
Contributor

Closes #100.

Subagents spawned via Task/Agent use Claude Code's native tools, which bypass aflock. Real-time enforcement of those inner calls is an upstream gap (claude-code#27661 / #34692, both closed-not-planned), so this PR hardens the boundary aflock can control:

  • Templates/examples deny both Task and Agent (distinct tool names; deny one ≠ deny the other).
  • policy.CheckSubagentMisconfig logs a WARNING at MCP + hook startup when a policy permits Task/Agent without declaring sublayouts; AFLOCK_STRICT=1 refuses to start.
  • Task/Agent attestations are tagged trustBoundaryCrossing; aflock verify flags sessions that delegated work out of the enforcement plane.
  • Docs: subagent trust boundary in policies.md + policy-schema.md; corrected the stale sublayouts status.

Out of scope (noted in code/docs): real-time enforcement of a subagent's inner native calls (upstream), and protected-file tamper detection (follow-up). Tests: CheckSubagentMisconfig matrix + attestation-tag tests; suite green.

…misconfig

Templates/examples now deny both subagent-spawning tools; new policy.CheckSubagentMisconfig warns at MCP+hook startup (AFLOCK_STRICT=1 refuses) when Task/Agent is permitted without sublayouts. Re #100.
Stamp predicate.trustBoundaryCrossing for subagent spawns; verify warns when a session delegated work outside aflock's enforcement plane. Re #100.
Cover Task vs Agent, deny precedence + glob matching, MCP-vs-hook enforcement limits, and safe delegation patterns; correct the stale sublayouts status. Re #100.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Docs Preview

Status Deployed
Branch fix/subagent-bypass-100
Preview URL https://fix-subagent-bypass-100.aflock-d0m.pages.dev

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