Charter
Open-source Python library that validates every agent API call field by field before it is sent and enforces whose customer account each call acts in.
At a Glance
Charter is an open-source Python library under the Apache 2.0 license that runs in your own process, with no per-call pricing.
Engagement
Available On
Alternatives
Listed Nov 2026
About Charter
Charter is an open-source Python library from R28 for agents that act in customers' accounts through APIs. Each tool is a Pydantic model that mirrors an API field by field, with the developer's own rules layered on top, and every call is checked against it before it is sent. It runs in the developer's own process rather than as a hosted service, and the latest listed release is v0.6.0.
What It Is
Charter is a tool-declaration and call-validation layer for LLM agents that use HTTP APIs, public or private. The developer declares a tool as a Pydantic model, and Charter builds the request from that model. The model only fills in the fields it is allowed to see. The docs describe it as a library like Pydantic, not a service: no signup, no proxy, no telemetry.
How the boundary works
A field marked FromContext() is supplied by the app on each call and is absent from what the model sees. A rule such as "only this customer's orders" therefore reads a value the model cannot change. Values can also be pinned out of the model's reach, and a Mode gives a tool different fields per plan or region. Rules such as caps, allowlists or any Python check run before any request. A call that breaks one is refused, and the model gets an error naming the field and the value it sent. Because nothing touches the network, rules can be tested offline with plain unit tests. An egress map lists everything each tool can reach, so it can be committed and diffed in code review.
Wire formats and responses
Transforms and Format declarations let the runtime build MIME, base64url, GraphQL, protobuf and key casing, so the model fills in plain fields. Packs trim responses by default, and an Envelope raises an error when an API returns a 200 that is really a failure. The docs report 534 live-API runs in which this surface produced none of the malformed GraphQL documents, undeclared endpoints or rejected base64 that a raw HTTP tool did, while noting that task success itself was a wash.
Packs and integrations
Seventeen APIs ship already declared, totaling 687 tools, including Gmail, Slack, GitHub, Linear, Notion, Stripe and Shopify. Tools can be exposed through OpenAI and LangChain adapters or served over MCP with charter-mcp. For an API with no pack, a coding agent can write the declaration using the project's skill. OAuth scopes can be derived from the tools handed out.
Limitations to know
The README says Charter describes one request, so loops, retries and multi-step flows belong in the agent. Multipart upload, request signing and streaming are not supported yet, and Mode controls what a tool exposes, not who may call it.
Community Discussions
Be the first to start a conversation about Charter
Share your experience with Charter, ask questions, or help others learn from your insights.
Pricing
Open Source
Charter is an open-source Python library under the Apache 2.0 license that runs in your own process, with no per-call pricing.
- Apache License 2.0
- Runs in your process; no proxy, no per-call pricing, no telemetry
- Install with pip install charter-ai (Python 3.10+)
Capabilities
Key Features
- Pydantic-model tool declarations that mirror API fields
- Per-call FromContext() values set by the app, hidden from the model
- Pre-request validation of caps, allowlists and custom Python rules
- Egress map listing everything each tool can reach
- Pinned values and Mode-based field sets per plan or region
- Deterministic wire formats (MIME, base64url, GraphQL, protobuf, key casing)
- Response trimming and Envelope error detection for 200 failures
- OAuth and API-key authentication with scopes_for scope derivation
- 687 ready-made tools across seventeen API packs
- OpenAI and LangChain adapters and an MCP server
- Offline unit testing of rules
- Tool schema trimming with derived(keep=...) to reduce token cost
