1. Learning objective
Define a Claude subagent
Declare one constrained Agent SDK subagent, give it one MCP tool, and capture its lifecycle as distinct evidence scopes.
- Guide 4 concepts
- Claude Agent SDK credential and model access
2. Technical context
Understand subagent permissions
Delegating research should not silently expand a main agent’s capabilities. A small subagent boundary makes its tool surface and evidence scope visible.
3. Run without AIGP
Run the multi-agent example
Run the existing claude-agent-subagent-intg lab. The main agent delegates once; the research subagent can only call lookup_policy and cannot create subagents.
cd labs/agent-frameworks/anthropic/claude-agent-subagent-intg
python3 -m venv .venv && source .venv/bin/activate
python -m pip install -r requirements.txt
export ANTHROPIC_API_KEY=...
export CLAUDE_MODEL=...
python app.py4. Configure AIGP
Configure subagent tracking
Enable the existing evidence reporter. Public SubagentStart/SubagentStop and tool hooks create an ordered main-agent → research-subagent → main-agent evidence timeline.
Authenticate local AIGP requests
Obtain a short-lived token
If your local OSS stack uses Keycloak, the organization and project headers are scope selectors, not authentication. Generate a token from the generated local OAuth client and pass it only through AI_GOVERNANCE_ACCESS_TOKEN for this terminal session.
# Run from the OSS repository after its local Keycloak stack is ready.
cd /path/to/ai-governance-oss
./servers.sh up
# This ignored file contains the local walkthrough client credentials.
# It does not contain an access token.
set -a
source .env.oauth.generated
set +a
# Mint one short-lived token in memory for this terminal only.
export AI_GOVERNANCE_ACCESS_TOKEN="$(
uv run python -c 'from ai_governance.oauth import access_token_from_environment; print(access_token_from_environment())'
)"
# Return to the Claude lab. Its .env supplies Claude and AIGP scope settings.
cd /path/to/labs/agent-frameworks/anthropic/claude-agent-subagent-intg
set -a
source .env
set +a
python app.py
# Remove the in-memory token when the session is over.
unset AI_GOVERNANCE_ACCESS_TOKENNever commit, print, paste into a screenshot, or add the token to .env. For development-mode and production workload identities, see Developer Authentication.
5. Inspect execution evidence
Inspect subagent evidence
Retrieve the AIGP execution. Confirm separate workflow steps and agent_scope metadata. The current public hook input does not expose a main-agent step ID for a parent_step_id, so the guide must not manufacture one.
Studio inventory for the multi-agent lab. Select the Main Agent to inspect its completed execution record.
Verified multi-agent timeline. It records Main Agent and Research Subagent lifecycle steps, model calls, one reported tool call, and completion.
6. Test failure handling
Test tool failures
Make the local policy lookup fail. The subagent can report that result, but it may not access another tool or spawn another agent to compensate.
7. Technical boundaries
Understand subagent boundaries
- Claude Agent SDK owns delegation and model execution.
- The application defines the allowed agent/tool surface.
- AIGP records bounded lifecycle evidence and does not become a subagent orchestrator.
8. Learning outcomes
Learning outcomes
You've progressed from your first Claude API request to an observable multi-agent workflow. Along the way, you've learned how to:
- Connect Claude applications to AIGP.
- Introduce tools and MCP into agent workflows.
- Track reported model calls, tool lifecycle evidence, and failure outcomes.
- Understand how agents delegate work to subagents.
- Inspect execution evidence without changing how Claude makes decisions.
Continue building Claude workflows
You now have the foundations to build more sophisticated agentic applications with greater visibility into their execution.
The next stage of this learning journey explores evaluations, governed actions, and execution replay. These advanced hands-on guides will become available as their integrations are validated.
Until then, experiment with the examples you've built. Add another tool, introduce a different failure scenario, or examine how delegation changes the execution evidence.
Explore more developer guides