Skip to content

About

TypeScript and Python SDKs for Agentic Control Plane: wrap tools, give subagents narrower child keys. Anthropic SDK, CrewAI, LangChain.

Topics

Resources

Security policy

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Agentic Control Plane SDKs

TypeScript and Python SDKs that wrap your agent's tools so each call is checked by ACP before it runs, and that give each subagent a narrower API key than its parent. Two things you can do:

  1. Govern your own tool calls. Wrap any tool with @governed / governed(). Before it runs, ACP decides allow, ask or deny based on your workspace policy, and output can be redacted on the way back.
  2. Spawn subagents with delegation chains. Use spawn_subagent() + child_context() (Python) or the equivalent TypeScript helpers to mint a scope-narrowed child API key for any subagent your agent creates. The gateway intersects scopes with the parent, atomically debits the parent's budget, keeps the originating human's identity (originSub), and produces audit logs that trace through the chain. See the agents-building-agents quickstart.

The adapters cover server-deployed agent frameworks: CrewAI, LangChain, Pydantic AI and the Anthropic SDK.

See it in working code: the Governed Agent Recipes: four runnable Python agents (~200 lines each) built on these SDKs. Concepts: runtime authorization · Anthropic Agent SDK integration guide

Packages

Node / TypeScript (packages/):

Package Purpose Status
@agenticcontrolplane/governance Thin core SDK, framework-agnostic. Wraps any tool handler. npm
@agenticcontrolplane/governance-anthropic Adapter for Anthropic Messages API + Claude Agent SDK. npm

Python (python/):

Package Purpose Status
acp-governance Thin core SDK, framework-agnostic. PyPI
acp-crewai Adapter for CrewAI (includes install_crew_hooks for inter-agent handoff capture). PyPI
acp-langchain Adapter for LangChain / LangGraph, plus Deep Agents with subagent coverage (acp_langchain.deepagents). PyPI

Quick starts

TypeScript (Anthropic SDK / any Node agent)

import { governHandlers, withContext } from "@agenticcontrolplane/governance-anthropic";

const handlers = governHandlers({
  web_search: async ({ query }) => doSearch(query),
});

app.post("/run", async (req, res) => {
  const token = req.header("authorization")!.slice("Bearer ".length);
  await withContext({ userToken: token }, async () => {
    // run your tool-use loop; handlers are governed
  });
});

Python (CrewAI)

from crewai.tools import tool
from acp_crewai import governed, install_crew_hooks, set_context

@tool("web_search")
@governed("web_search")
def web_search(query: str) -> str:
    return do_search(query)

@app.post("/run")
def run(topic: str, authorization: str = Header(...)):
    set_context(user_token=authorization.removeprefix("Bearer ").strip())
    crew = Crew(agents=[...], tasks=[...])
    install_crew_hooks(crew)   # also captures inter-agent handoffs
    return {"result": str(crew.kickoff())}

Python (LangChain / LangGraph / Deep Agents)

from langchain.agents import create_agent
from langchain.tools import tool
from acp_langchain import ACPMiddleware, set_context

@tool
def web_search(query: str) -> str:
    return do_search(query)

agent = create_agent(model="openai:gpt-4o-mini", tools=[web_search],
                     middleware=[ACPMiddleware()])   # every tool, one registration

Deep Agents: from acp_langchain.deepagents import create_deep_agent, same signature as deepagents', with ACP on the main agent and every subagent. Legacy chains / custom StateGraph: stack @governed("web_search") under @tool.

Protocol

All packages speak the same wire protocol to the ACP gateway, the same shape Claude Code's hook uses:

  • POST /govern/tool-use: { tool_name, tool_input, session_id } + Authorization: Bearer <user-jwt> returns { decision: "allow" | "deny" | "ask", reason? }
  • POST /govern/tool-output: same + tool_output returns { action: "pass" | "redact" | "block", modified_output?, findings? }
  • Fail-open on network errors, timeouts (5s default), gateway 5xx and a missing configuration. The call proceeds, and the reason is recorded as fail-open (unreachable) or similar so the lapse is visible.

Third-party frameworks that don't have a first-class adapter can call these endpoints directly. The snippet is about 20 lines in any language.

Development

# Node
npm install
npm run build       # build TS packages
npm run typecheck   # across the workspace

# Python — install each package editable into a venv
python -m venv .venv && source .venv/bin/activate
pip install -e python/acp-governance -e python/acp-crewai -e python/acp-langchain

Repo layout

packages/                             # npm workspace
  governance/                         # @agenticcontrolplane/governance
  governance-anthropic/               # @agenticcontrolplane/governance-anthropic
examples/                             # worked examples (Anthropic PR reviewer, framework scout)
python/                               # PyPI packages (each standalone)
  acp-governance/
  acp-crewai/
  acp-langchain/

Status

Pre-release. Until 1.0, expect API changes. Pin exact versions in production.

License

MIT. See LICENSE.

Related

About

TypeScript and Python SDKs for Agentic Control Plane: wrap tools, give subagents narrower child keys. Anthropic SDK, CrewAI, LangChain.

Topics

Resources

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages