{"slug": "trustgraph-acls-that-follow-the-data-through-your-ai-agents", "title": "TrustGraph – ACLs that follow the data through your AI agents", "summary": "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.", "body_md": "**Policy-as-code for what AI agents produce.**\nDecide where your agent's output can go, based on what it read.\n\n[Try the playground](https://trustgraph-demo.vercel.app) ·\n[Write a policy](https://github.com/skishore23/trustgraph/blob/main/docs/agents/writing-policies.md) ·\n[How we know it works](https://github.com/skishore23/trustgraph/blob/main/docs/verification.md)\n\nPermission systems decide what an agent may **read**. They lose track the\nmoment the agent **writes** something new.\n\nIn May 2025, Invariant Labs\n[showed](https://invariantlabs.ai/blog/mcp-github-vulnerability) a coding\nagent reading a user's private repositories and publishing what it found in a\npull request on a public one, after it read a crafted issue. Every step was\nsomething the agent was allowed to do. Reading private code was fine. Opening\na public pull request was fine. Nothing checked that the second came from the\nfirst.\n\nTaking 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.\n\nYou 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:\n\n```\nversion: 1\n\ngroups:\n  hr: [nina]\n  engineering: [sam, ravi]\n  leadership: [maya]\n\nagents: [researcher, planner]\n\nsources:\n  salaries:   { readers: [hr],                          agents: [researcher, planner] }\n  roadmap:    { readers: [hr, engineering, leadership], agents: [planner] }\n  benchmarks: { readers: [hr, engineering, leadership], agents: [researcher, planner] }\n\nactions:\n  post_to_engineering: { agents: [planner], audience: [engineering] }\n  brief_hr:            { agents: [planner], audience: [hr] }\n  brief_leadership:\n    agents: [planner]\n    audience: [leadership]\n    approval: { reviewers: [hr], valid_for: 1h }\n```\n\nTrustGraph records what each output was built from, through every step, and\nanswers **allow**, **needs approval** or **deny** with the reason:\n\n| What the output carries | It wants to | Answer | \n|---|---|---|\n| planning notes (from `salaries` ) +`roadmap` | `post_to_engineering` | **Deny.**`salaries` is readable by hr only; engineering (ravi, sam) is not included | \n| the same summary | `brief_hr` | **Allow** | \n| `roadmap` only | `post_to_engineering` | **Allow** | \n| `roadmap` +`benchmarks` | `brief_leadership` | **Needs approval.** action`brief_leadership` requires a reviewer to approve it | \n\nThe full file, with its tests, is\n[examples/policies/handoff.policy.yaml](https://github.com/skishore23/trustgraph/blob/main/examples/policies/handoff.policy.yaml).\n\nThe rule is small:\n\n```\nreaders(output) = the people who may read every input\nan action is allowed only if everyone who receives it is one of those readers\n```\n\nApproval adds a requirement. It never widens who may read a source. Anything the policy does not name is denied.\n\nDecisions are deterministic. There is no model in the decision path.\n\nRequires Rust 1.90 or newer.\n\n```\ncargo install --locked --git https://github.com/skishore23/trustgraph trustgraph-cli\n\ntrustgraph policy init                         # writes trustgraph.policy.yaml\ntrustgraph policy check trustgraph.policy.yaml\ntrustgraph policy test trustgraph.policy.yaml\nok: 0 errors, 0 warnings\nPASS salary data never reaches engineering\nPASS roadmap summary can be posted\n2 passed, 0 failed\n```\n\nA policy carries its own tests. Each one states what the agent read, what it tries to do and the answer you expect.\n\nRead a policy back in plain English, see exactly who gains access when it changes, and run it through the simulator:\n\n```\ntrustgraph policy explain trustgraph.policy.yaml\ntrustgraph policy diff old.policy.yaml new.policy.yaml\ntrustgraph policy simulate trustgraph.policy.yaml\nsalaries: output can reach hr (nina). Usable by agent planner.\nemail_customer: mailer may send to customers (acme) after approval by sales (leo), valid 30m.\n\nWIDENS  source salaries: readers gained ravi, sam\n\n64 runs, 12,936 events: 994 allow, 5,082 deny, 392 needs_approval — 0 violations\n```\n\nEvery command takes `--json`. There are six worked policies in\n[examples/policies](https://github.com/skishore23/trustgraph/blob/main/examples/policies).\n\nTrustGraph assumes an agent drafts the policy and a person approves it. Every\nproblem is reported at once with a path, a stable code and a suggestion, so an\nagent can run the loop `init` → `check` → `test` → `simulate` → `explain` →\n`diff` on its own. A person then reviews the plain-English explanation and a\ndiff in which every widening of access is marked.\n\nPoint your agent at [docs/agents/writing-policies.md](https://github.com/skishore23/trustgraph/blob/main/docs/agents/writing-policies.md)\nor [llms.txt](https://github.com/skishore23/trustgraph/blob/main/llms.txt). Protect the policy file with code review.\n\n**Status.** The policy CLI and `trustgraph serve` have been through security\nreview. `trustgraph gateway` and the Python integrations are new: two review\nrounds found and fixed real holes, and a third is in progress. Try them, but\ndo not put them in front of real data yet.\n\nPut the gateway between your agents and the MCP servers they use. It holds\nthe servers' credentials, records what each agent reads through them, and\nchecks every action against it before forwarding the call. Agents cannot\nskip it as long as the gateway alone holds the upstream credentials and the\nagents have no other route to those servers. A `gateway.yaml` says which\ntool reads which source, which tool is which action, and which arguments\neach tool may carry:\n\n```\ntrustgraph gateway --policy trustgraph.policy.yaml --operator leo --config gateway.yaml\nplanner 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)\n```\n\nConfig, sessions, hand-offs and the threat model:\n[docs/gateway.md](https://github.com/skishore23/trustgraph/blob/main/docs/gateway.md). A runnable example:\n[examples/gateway](https://github.com/skishore23/trustgraph/blob/main/examples/gateway).\n\nA 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.\n\n```\ntrustgraph serve --policy trustgraph.policy.yaml --operator leo\n```\n\nAsk right before acting:\n\n```\ncurl -s localhost:8787/v1/check \\\n  -H \"Authorization: Bearer $(cat ~/.trustgraph/serve/tokens/mailer.token)\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"artifact\": \"<artifact id>\", \"action\": \"email_customer\"}'\n```\n\nThe API, the MCP endpoint, tokens, the operator page, limits and the threat\nmodel are in [docs/serve.md](https://github.com/skishore23/trustgraph/blob/main/docs/serve.md).\n\nMark what reads a source and what acts; inside a session, what was read\nfollows what is written ([SDK reference](https://github.com/skishore23/trustgraph/blob/main/docs/sdk-python.md)):\n\n``` python\nimport trustgraph\n\nclient = trustgraph.Client(token_file=\"~/.trustgraph/serve/tokens/planner.token\")\n\n@trustgraph.source(\"salaries\")\ndef read_salaries():\n    return \"nina: 120k, sam: 95k\"\n\n@trustgraph.action(\"post_to_slack\", content=lambda args, kwargs: args[0])\ndef post_to_slack(text):\n    print(\"posted:\", text)               # runs only on allow\n\nwith client.session():\n    read_salaries()\n    try:\n        post_to_slack(\"Q3 headcount plan\")\n    except trustgraph.Denied as e:\n        print(e.decision.verdict, e.decision.reason)\ndeny denied: `salaries` is readable by hr only; engineering (ravi, sam) is not included\n```\n\nIntegrations, each with a hand-off example: [LangChain / LangGraph, OpenAI\nAgents SDK and Claude Agent SDK](https://github.com/skishore23/trustgraph/blob/main/docs/integrations.md). A wrapper checks only\nthe tools it wraps.\n\n[`trustgraph-policy`](https://github.com/skishore23/trustgraph/blob/main/crates/trustgraph-policy) parses, tests, explains and\ndiffs policies, and `decide` is a pure function (`cargo run -p trustgraph-policy --example decide`). [` trustgraph-engine`](https://github.com/skishore23/trustgraph/blob/main/crates/trustgraph-engine)\nis the journaled runtime `trustgraph serve` runs.\n\n- **One decision order.** The allow / needs-approval / deny ordering lives in\none small kernel that both the policy function and the runtime call.\n- **Bounded proofs of the core rules.** Ten[Kani](https://model-checking.github.io/kani/) harnesses cover that kernel, the approval time window and the reader-set\nrules. All ten pass in CI.\n- **A simulator that runs the real runtime.** Seeded runs drive the same code\nthrough policy changes, crashes, torn journal writes and approval expiry,\nand check five safety rules on every step against a check computed from the\npolicy text alone. Three deliberately broken builds of the runtime must be\ncaught, and are.\n\nThe proofs are bounded and cover the core rules, not the whole system. The\nsimulator shows the absence of violations in the runs it made, not in all\npossible runs. [Verification scope and reproduction](https://github.com/skishore23/trustgraph/blob/main/docs/verification.md)\nstates exactly what each covers.\n\n- **It only knows what you tell it.** If your system does not report a source\nthe agent read, TrustGraph cannot account for it.\n- **It decides; it does not act.** Except through the gateway, your system\nmust ask right before it acts, and act only on*allow* .\n- **The rule is strict.** One sensitive input restricts the whole output to\nthat input's readers. There is no \"this summary is safe to share\" exception\nyet.\n- **Groups are lists in the file.** They are not synced from an identity\nprovider.\n\nPermission databases such as SpiceDB or OpenFGA decide what your agent may read. TrustGraph decides where what it wrote may go. Use both.\n\n| Path | What it is | \n|---|---|\n| `crates/trustgraph-policy` | The policy file: parsing, decisions, tests, explain, diff, schema, starter | \n| `crates/trustgraph-engine` | Deterministic runtime core, journal and replay | \n| `crates/trustgraph-core` | Proof-friendly kernels and their Kani harnesses | \n| `crates/trustgraph-framework` | The lineage graph the engine is built on | \n| `crates/trustgraph-sim` | The seeded policy simulator and its safety checks | \n| `crates/trustgraph-cli` | The `trustgraph` command:`policy` ,`serve` and`gateway` | \n| `sdk/python` | The Python SDK and its framework integrations | \n| `examples/policies` | Six worked policies | \n| `examples/gateway` | The hand-off story through the gateway | \n| `examples/integrations` | A hand-off example per integration | \n| `docs/agents` | The policy-writing guide for agents | \n| `web` ,`api` ,`hosted` | The public site and its playground endpoint | \n\n```\ncargo fmt --all --check\ncargo clippy --workspace --all-targets --locked -- -D warnings\ncargo test --workspace --locked\n```\n\nSee [development](https://github.com/skishore23/trustgraph/blob/main/docs/development.md) and [the public site](https://github.com/skishore23/trustgraph/blob/main/docs/vercel.md).", "url": "https://wpnews.pro/news/trustgraph-acls-that-follow-the-data-through-your-ai-agents", "canonical_source": "https://github.com/skishore23/trustgraph", "published_at": "2026-11-16 06:44:22+00:00", "updated_at": "2026-11-16 06:52:49.408423+00:00", "lang": "en", "topics": ["ai-agents", "ai-safety", "ai-policy", "developer-tools", "agent-protocols"], "entities": ["TrustGraph", "Invariant Labs", "skishore23", "Rust", "trustgraph-cli"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/trustgraph-acls-that-follow-the-data-through-your-ai-agents", "markdown": "https://wpnews.pro/news/trustgraph-acls-that-follow-the-data-through-your-ai-agents.md", "text": "https://wpnews.pro/news/trustgraph-acls-that-follow-the-data-through-your-ai-agents.txt", "jsonld": "https://wpnews.pro/news/trustgraph-acls-that-follow-the-data-through-your-ai-agents.jsonld"}}