Two Safe AI Agents Can Combine to Break Every Safety Rule
A new formal proof shows two individually safe AI agents can combine into an unsafe system, and pairwise dependency graphs can never catch it.
ProTakeaways
- First formal proof that AI safety is non-compositional under conjunctive capability dependencies (arXiv 2603.15973).
- Two agents individually safe can combine to reach a forbidden goal; minimum counterexample uses only 3 nodes.
- Directed hypergraphs replace pairwise graphs; closure planning runs in O(n + m·k) linear time.
- Empirically, 42.6% of real multi-tool trajectories contain conjunctive dependencies invisible to graph models.
- Workflow planners violate safety on 38.2% of conjunctive instances; hypergraph planner provably produces zero violations.
- No open-source code released; methods covered by a provisional patent on hypergraph closure safety verification.
A new theoretical paper delivers an uncomfortable result for anyone building modular agentic systems: safety does not compose. Two agents that each pass every individual safety check can, when their capabilities are pooled, reach a forbidden goal that neither could touch alone. The paper proves this formally for the first time in the capability-composition setting, and shows the failure is structurally invisible to any dependency model based on ordinary directed graphs.
The result matters because the standard way of auditing agentic pipelines, tool-augmented LLMs, and multi-agent coalitions is to verify components individually and assume composition preserves the guarantees. The paper argues that any architecture that validates components individually and then composes them has no formal guarantee of system-level safety, regardless of how carefully those components are designed.
The three-node counterexample that breaks component audits
The core proof is almost embarrassingly small. Take three capabilities u1, u2, f, where f is forbidden, and one rule saying that holding both u1 and u2 together produces f. Agent A holds only u1. Agent B holds only u2. Individually, neither can derive f. Merge their capability sets and the forbidden goal falls out immediately.
The result is tight: it requires exactly three capabilities and one conjunctive hyperedge, and cannot arise in any pairwise graph. That tightness is the actual contribution. A minimal proof of a tight bound establishes that the failure is structurally irreducible, not something that better component design can patch.
Why directed graphs quietly lie about dependencies
Most capability modelling uses directed graphs, where an edge (u, v) means possessing u is sufficient to enable v. This encoding is expressive enough for chains of tools, but it structurally cannot represent a rule like “v requires u1 AND u2 simultaneously,” which is the shape of most real multi-step workflows: intent plus context plus database access enables an answer; price plus visa clearance enables a booking.
Any encoding of conjunction in a directed graph requires artificial intermediate nodes that represent logical conjunctions rather than genuine capabilities. Those synthetic AND-nodes sit outside the actual capability set, which is exactly where the safety failure hides.
Hypergraphs, closure, and a linear-time planner
The paper replaces graphs with directed hypergraphs, where each hyperedge has a set of tail nodes (all required simultaneously) and a set of head nodes (all produced together). Reachability is then a fixed-point closure: start from an initial capability set, fire every hyperedge whose tail is fully contained, add the heads, repeat.
This is not a novel data structure, but the paper does two useful things with it. First, it proves that planning reduces to a single closure computation, which is the capability-hypergraph instance of the completeness theorem for Horn clause forward chaining from van Emden and Kowalski. Second, it gives an optimised worklist algorithm using per-hyperedge counters that runs in O(n + m·k) where n is capabilities, m is hyperedges, and k is the maximum tail size. Linear in the size of the hypergraph.
The closure operator has a shape numerical optimisers will recognise: the closure gain function is normalised, monotone, and submodular via the polymatroid rank theorem, giving a (1 - 1/e) guarantee for greedy capability acquisition.
The Safe Audit Surface
The most practically consequential construction is the Safe Audit Surface, a polynomial-time-computable map that, for a given deployment configuration, classifies every capability into one of three buckets:
- Already safely reachable via the current closure.
- One safe acquisition step away (the “near-miss frontier”).
- Structurally unsafe: every path to it passes through a forbidden capability.
The surface comes with derivation certificates: each emergent capability carries the hyperedge sequence that produced it, verifiable in time proportional to the certificate length. This turns safety auditing from a search problem into a lookup against a precomputed structure.
The complexity picture
The paper pins down where the hard parts actually live:
| Problem | Complexity |
|---|---|
| Planning / goal reachability | Polynomial, O(n + m·k) |
| Emergent capability detection | P-complete |
| Minimal unsafe set membership | coNP-complete |
| Online coalition safety check (given precomputed boundary) | Linear-time set-cover query |
| Single-edge adversarial injection check | Polynomial |
| Budget-b (b≥2) adversarial injection | NP-hard |
The P-completeness result has an operational sting: emergent capability detection cannot be efficiently parallelised assuming NC is not equal to P, so checking whether new capabilities emerge from a coalition cannot be decomposed into independent sub-checks on individual agents or pairs. This is a formal statement of why per-component audits are insufficient.
How often does this happen in real pipelines?
To check whether conjunctive dependencies are a rare corner case or a common pattern, the paper runs empirical validation on 900 trajectories from ToolBench G3 and TaskBench DAG.
- 42.6% of real multi-tool trajectories contain conjunctive dependencies, with a 95% confidence interval of 39.4% to 45.8%.
- On real asynchronous ToolBench G3 trajectories, the workflow planner produces AND-violations on 38.2% of conjunctive instances and the capability graph planner on 21.4%.
- The hypergraph planner produces zero AND-violations, which is a proved theorem rather than an experimental finding.
- Inter-annotator agreement on the conjunctive-witness rule reached Cohen’s
κ = 0.81. - Cross-corpus replication on AgentBench and Gorilla / APIBench is planned but not yet complete.
The gap between the capability graph’s 0% synthetic rate and 21.4% async rate is worth noting: symmetric synthetic branches assign concurrent capabilities in lock-step, which hides timing-dependent violations that only surface once branches run at realistic latencies.
What this is useful for, and what it is not
The framework is aimed at offline safety certification and pre-execution gating for modular agentic systems. Practical uses include:
- Auditing tool-augmented LLM deployments for coalitions of tools that jointly reach a forbidden output.
- Precomputing the minimal unsafe antichain once, then answering online coalition-safety queries in linear time.
- Incrementally maintaining safety guarantees as new tools or APIs are registered, using the O(n + m·k) insertion and deletion updates.
- Producing certifiable derivation traces that survive review and reproduce a specific unsafe path.
It is not a runtime monitor for stochastic LLM behaviour, and the authors are clear about several limits. Computing the boundary of minimal unsafe sets is coNP-complete in general, which is why the paper emphasises the offline/online split. The empirical prevalence figure rests on an automated annotation rule that has been validated on a 10% hand-labelled sample but not yet against a fully independent ground truth. And the framework models capabilities as persistent (once derived, always available), so it is closer to Horn-clause forward chaining than to Petri-net-style resource consumption.
Code, models, and reproduction
This is a theoretical paper. There is no released implementation, model, or open-source repository accompanying the release, and the author notes that the methods are covered by a provisional patent on capability-based safety verification using directed hypergraph closure. The algorithms described (closure worklist, coalition check, incremental maintenance) are simple enough to reproduce directly from the paper, but researchers wanting a reference implementation will need to build one themselves for now.
The real breakthrough
The mathematical machinery, hypergraphs, closure operators, submodular gain, Horn-clause completeness, is not new. What is new is packaging them into a formal safety infrastructure for agentic AI where the non-compositionality theorem, the lattice structure of the safe region, the P-complete detection problem, and the coNP-complete boundary computation combine into a single certifiable audit surface. It reframes safety in composed systems from “did each part pass its check” to “what does the closure of the joint capability set contain,” and gives an efficient way to answer that second question.