Agent spawning: create scoped agents with distinct harnesses#35
Merged
Conversation
The orchestrator can now spawn agents, not just dispatch to ones that exist. Each spawned agent is a scoped identity, not a trusted one -- its token carries only its harness scopes, so a reviewer reaches GitHub and nothing else. - AgentSpec (name, harness scopes, task); Team.spawn mints the scoped token and launches the agent through a pluggable Spawner, passing name/token/task/ channel by environment. AgentContext.from_env() picks it up inside the process. - Default SubprocessSpawner runs a fixed command per agent; swap it for any Spawner. hallpass stays model-agnostic -- the loop inside the process is yours. - Team tracks handles (alive/shutdown). Demos: examples/spawn_agents.py + spawned_agent.py (two real subprocess agents coordinating over one channel). Additive. 268 tests (+7, incl. real-subprocess env-passing + lifecycle), mypy --strict, ruff (whole repo), catalog freshness all green. v1.2.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The orchestrator can now create agents, not just dispatch to ones that already exist, each with a different harness and a different task, all coordinating over the channels. And the reason to build it on hallpass:
Team.spawnmints each agent a token carrying only its harness scopes, then launches it through a pluggableSpawner, passing the identity, task, and channel by environment:github:readand nothing else; the messenger's carriesslack:writeand nothing else. A confused or compromised agent can only reach the tools its harness grants, enforced at call time and audited. Isolation between agents is the auth layer.SubprocessSpawneris the default; swap it for anySpawner.Teamtracks handles (alive/shutdown).7 new tests:
AgentContext.from_envround-trip + missing-env,Team.spawnmints a scope-limited token and builds the env, different agents get different harnesses, alive/shutdown, and two real-subprocess tests (env passing end to end, and lifecycle/terminate). Runnable two-process demo:examples/spawn_agents.py+examples/spawned_agent.py. Additive over 1.x. 268 tests, mypy --strict, ruff (whole repo), catalog-freshness green. v1.2.0.