TrustGraph – ACLs that follow the data through your AI agents TrustGraph, an open-source project by developer skishore23, released a policy-as-code tool that tracks what an AI agent read and restricts where outputs derived from that data can go, addressing the May 2025 Invariant Labs disclosure in which a coding agent read private repositories and published findings in a public pull request after ingesting a crafted issue. Policies are written in a YAML file naming groups, agents, sources and actions, and TrustGraph returns allow, needs approval or deny with a reason; the decision path contains no model and is deterministic, requiring Rust 1.90 or newer. The tool ships with a CLI (trustgraph policy init, check, test, explain, diff, simulate) and supports embedded tests, with the example policy and tests in examples/policies/handoff.policy.yaml. Policy-as-code for what AI agents produce. Decide where your agent's output can go, based on what it read. Try the playground https://trustgraph-demo.vercel.app · Write a policy https://github.com/skishore23/trustgraph/blob/main/docs/agents/writing-policies.md · How we know it works https://github.com/skishore23/trustgraph/blob/main/docs/verification.md Permission systems decide what an agent may read . They lose track the moment the agent writes something new. In May 2025, Invariant Labs showed https://invariantlabs.ai/blog/mcp-github-vulnerability a coding agent reading a user's private repositories and publishing what it found in a pull request on a public one, after it read a crafted issue. Every step was something the agent was allowed to do. Reading private code was fine. Opening a public pull request was fine. Nothing checked that the second came from the first. Taking away access does not fix this: the agent needs the private code to do its job. What is missing is a rule about where things derived from it may go. The same gap opens each time one agent hands its work to another: the restriction should follow the data through every step. You write one small policy file. It says who may read anything derived from each source, which agents may use it, and where each action sends output: version: 1 groups: hr: nina engineering: sam, ravi leadership: maya agents: researcher, planner sources: salaries: { readers: hr , agents: researcher, planner } roadmap: { readers: hr, engineering, leadership , agents: planner } benchmarks: { readers: hr, engineering, leadership , agents: researcher, planner } actions: post to engineering: { agents: planner , audience: engineering } brief hr: { agents: planner , audience: hr } brief leadership: agents: planner audience: leadership approval: { reviewers: hr , valid for: 1h } TrustGraph records what each output was built from, through every step, and answers allow , needs approval or deny with the reason: | What the output carries | It wants to | Answer | |---|---|---| | planning notes from salaries + roadmap | post to engineering | Deny. salaries is readable by hr only; engineering ravi, sam is not included | | the same summary | brief hr | Allow | | roadmap only | post to engineering | Allow | | roadmap + benchmarks | brief leadership | Needs approval. action brief leadership requires a reviewer to approve it | The full file, with its tests, is examples/policies/handoff.policy.yaml https://github.com/skishore23/trustgraph/blob/main/examples/policies/handoff.policy.yaml . The rule is small: readers output = the people who may read every input an action is allowed only if everyone who receives it is one of those readers Approval adds a requirement. It never widens who may read a source. Anything the policy does not name is denied. Decisions are deterministic. There is no model in the decision path. Requires Rust 1.90 or newer. cargo install --locked --git https://github.com/skishore23/trustgraph trustgraph-cli trustgraph policy init writes trustgraph.policy.yaml trustgraph policy check trustgraph.policy.yaml trustgraph policy test trustgraph.policy.yaml ok: 0 errors, 0 warnings PASS salary data never reaches engineering PASS roadmap summary can be posted 2 passed, 0 failed A policy carries its own tests. Each one states what the agent read, what it tries to do and the answer you expect. Read a policy back in plain English, see exactly who gains access when it changes, and run it through the simulator: trustgraph policy explain trustgraph.policy.yaml trustgraph policy diff old.policy.yaml new.policy.yaml trustgraph policy simulate trustgraph.policy.yaml salaries: output can reach hr nina . Usable by agent planner. email customer: mailer may send to customers acme after approval by sales leo , valid 30m. WIDENS source salaries: readers gained ravi, sam 64 runs, 12,936 events: 994 allow, 5,082 deny, 392 needs approval — 0 violations Every command takes --json . There are six worked policies in examples/policies https://github.com/skishore23/trustgraph/blob/main/examples/policies . TrustGraph assumes an agent drafts the policy and a person approves it. Every problem is reported at once with a path, a stable code and a suggestion, so an agent can run the loop init → check → test → simulate → explain → diff on its own. A person then reviews the plain-English explanation and a diff in which every widening of access is marked. Point your agent at docs/agents/writing-policies.md https://github.com/skishore23/trustgraph/blob/main/docs/agents/writing-policies.md or llms.txt https://github.com/skishore23/trustgraph/blob/main/llms.txt . Protect the policy file with code review. Status. The policy CLI and trustgraph serve have been through security review. trustgraph gateway and the Python integrations are new: two review rounds found and fixed real holes, and a third is in progress. Try them, but do not put them in front of real data yet. Put the gateway between your agents and the MCP servers they use. It holds the servers' credentials, records what each agent reads through them, and checks every action against it before forwarding the call. Agents cannot skip it as long as the gateway alone holds the upstream credentials and the agents have no other route to those servers. A gateway.yaml says which tool reads which source, which tool is which action, and which arguments each tool may carry: trustgraph gateway --policy trustgraph.policy.yaml --operator leo --config gateway.yaml planner slack post message engineering: error: TrustGraph gateway: post to engineering was not forwarded: denied: salaries is readable by hr only; engineering ravi, sam is not included denied Config, sessions, hand-offs and the threat model: docs/gateway.md https://github.com/skishore23/trustgraph/blob/main/docs/gateway.md . A runnable example: examples/gateway https://github.com/skishore23/trustgraph/blob/main/examples/gateway . A local service over HTTP and MCP, so any agent stack can register what it read, record what it wrote and ask before it acts. Each agent gets its own token; a person, the operator, approves requests on a local page. trustgraph serve --policy trustgraph.policy.yaml --operator leo Ask right before acting: curl -s localhost:8787/v1/check \ -H "Authorization: Bearer $ cat ~/.trustgraph/serve/tokens/mailer.token " \ -H "Content-Type: application/json" \ -d '{"artifact": "