TRIDENT: Tri-LLM Reference Monitor & Provable Agent Security

TRIDENT (`arXiv:2611.35150`) is a Lean-verified Tri-LLM security architecture enabling dynamic data-dependent replanning while bounding indirect prompt injection. By splitting an agent into a Planner-LLM (never sees raw untrusted text), a zero-permission Data-LLM, and a Policy-LLM gated by a deterministic reference monitor, TRIDENT bounds attacker trace influence to 2^(beta+sigma) and solves 54%–74% of ReplanInject tasks under attack.
TRIDENT: Tri-LLM Reference Monitor & Provable Agent Security: TRIDENT (`arXiv:2611.35150`) is a Lean-verified Tri-LLM security architecture enabling dynamic data-dependent replanning while bounding indirect prompt injection. By splitting an agent into a Planner-LLM (never sees raw untrusted text), a zero-permission Data-LLM, and a Policy-LLM gated by a deterministic reference monitor, TRIDENT bounds attacker trace influence to 2^(beta+sigma) and solves 54%–74% of ReplanInject tasks under attack. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- Strict 3-Model Privilege Separation: Planner-LLM never sees raw untrusted text; Data-LLM holds zero tool permissions; Policy-LLM reads trusted inputs only.
- Provable Influence Bound: Deterministic reference monitor caps untrusted influence via budget `beta` and feedback budget `sigma` (`<= 2^(beta+sigma)` traces).
- Machine-Checked Lean Formalization: Root-policy soundness and non-interference properties are formally proven in Lean.
- Supports Data-Dependent Replanning: Solves 54%–74% of ReplanInject tasks under adaptive attacks (0% attack success with human-in-the-loop).
import { createAgent } from '@smoke-monkey/harness';// Isolate untrusted retrieval inside a zero-permission Data-LLM workerconst dataReaderAgent = createAgent({agentId: 'trident-data-llm',provider: 'ollama',model: 'qwen3.8:27b',workspacePath: process.cwd(),permissions: { read_file: 'allow', write_file: 'deny', run_command: 'deny' },});const plannerAgent = createAgent({agentId: 'trident-planner-llm',provider: 'anthropic',model: 'claude-sonnet-4-20250514',workspacePath: process.cwd(),permissions: { read_file: 'deny', write_file: 'ask', run_command: 'ask' },});async function runMeteredReplan() {// Data-LLM returns finite-range enum/boolean answers rather than raw untrusted proseconst dataSignal = await dataReaderAgent.run('Classify ticket severity as {LOW, HIGH} only.');const planResult = await plannerAgent.run(`Execute root-policy workflow for severity=${dataSignal.summary}`);console.log('TRIDENT Verified Outcome:', planResult.summary);}runMeteredReplan().catch(console.error);
Watch: Related Video Guides
AI Safety And LLM Security New Playlist- Why To Learn In 2027- Prompt Injection LLM01
Part 2 | How LLM Applications Really Work | AI Security Architecture, RAG, Agents & Attack Surfaces
What Is TRIDENT? Solving the Data-Dependent Replanning Dilemma
Static plan-locking defenses neutralize indirect prompt injection by freezing an agent's tool sequence before reading external data—breaking any real workflow where a fetched email, bug report, or API payload legitimately changes what the agent must do next.
TRIDENT (arXiv:2611.35150, Penn State & Bosch Research) preserves data-dependent replanning with formal information-flow guarantees. It partitions the agent across three isolated LLMs coordinated by a deterministic reference monitor: a Planner-LLM that never sees raw untrusted text, a Data-LLM that reads untrusted inputs with zero tool execution permissions, and a Policy-LLM that synthesizes execution policies strictly from trusted user inputs.
Lean-Verified Bounds, AgentDojo & ReplanInject Benchmarks
TRIDENT meters every bit flowing from the Data-LLM to the Planner-LLM through finite-range queries (e.g., enums, booleans, bounded feedback) under an explicit influence budget beta and feedback budget sigma, guaranteeing that for fixed trusted inputs and randomness, an attacker can steer the execution among at most 2^(beta + sigma) observable traces.
| Defense Property / Benchmark | TRIDENT Result | Security / Utility Mechanism |
|---|---|---|
| Formal Security Model | Machine-checked in Lean | Every executed tool call provably satisfies root policy |
| Observable Attacker Traces | At most `2^(beta + sigma)` | Metered finite-range Data-LLM disclosure channel |
| ReplanInject (Under Attack) | 54% – 74% task completion | Highest average utility under attack across 4 tested models |
| Adaptive Attacks + HITL | 0% attack success | Deterministic reference monitor + human policy confirmation |
Even against adaptive prompt injection crafted specifically to exploit replanning branches on ReplanInject and AgentDojo, TRIDENT outperforms all baseline defenses while keeping policy integrity strictly isolated from untrusted data.
Building a Metered Data-LLM Reference Monitor in TypeScript
Developers can enforce TRIDENT's disclosure-budget pattern in production multi-agent systems by forcing Data-LLM workers to emit strictly validated finite-range schemas while tracking cumulative channel bits (beta + sigma) in the orchestrator.
export class TridentReferenceMonitor {
private bitsUsed = 0;
constructor(private readonly maxBudgetBits: number) {}
discloseEnum<T extends string>(answer: T, allowedValues: readonly T[]): T {
if (!allowedValues.includes(answer)) {
throw new Error(`Monitor blocked out-of-range Data-LLM disclosure: ${answer}`);
}
const bitCost = Math.ceil(Math.log2(allowedValues.length));
if (this.bitsUsed + bitCost > this.maxBudgetBits) {
throw new Error(`Influence budget exceeded (${this.bitsUsed + bitCost} > ${this.maxBudgetBits} bits)`);
}
this.bitsUsed += bitCost;
return answer;
}
}Finite-Range Channels Defeat Arbitrary String Smuggling
Never pass free-form summaries from a Data-LLM straight into your Planner-LLM prompt. Restrict Data-LLM responses to discrete enums, IDs, or bounded integers metered by bit budget.
Multi-Agent Privilege Separation on Smoke Monkey Canvas
Smoke Monkey Canvas makes TRIDENT's Tri-LLM separation visual and auditable: you can place an untrusted-data reader node with write_file: deny, run_command: deny, wire its finite-range output edge to a privileged Planner agent, and enforce deterministic monitor checks between zones.
Frequently Asked Questions
Q:What are the three LLMs in the TRIDENT security architecture?
TRIDENT splits execution across a Planner-LLM (never reads raw untrusted text), a Data-LLM (reads untrusted data but holds zero tool permissions), and a Policy-LLM (writes security policies strictly from trusted inputs).
Q:How does TRIDENT allow dynamic replanning without falling victim to prompt injection?
A deterministic reference monitor lets the Planner-LLM query the Data-LLM only through finite-range answers and feedback metered against an influence budget `beta` and feedback budget `sigma`.
Q:What does TRIDENT's Lean formalization prove?
The machine-checked Lean proofs guarantee that an attacker can select among at most `2^(beta + sigma)` observable execution traces and that every executed tool call satisfies the trusted root policy.
Q:How well does TRIDENT perform on ReplanInject and AgentDojo?
Across four evaluated models on ReplanInject, TRIDENT completes 54% to 74% of tasks under attack—more than any competing defense—and achieves 0% attack success with human-in-the-loop approval.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.