Agent-Sentry: Bounding LLM Agents via Execution Provenance
Organizations: University of Southern California, Los Angeles, California, USA · Washington University in St. Louis, St. Louis, Missouri, USA
Abstract
Agentic computing systems, while immensely capable, raise serious security, privacy, and safety concerns. A key issue is that the full set of functionalities offered by these systems, combined with their probabilistic execution flows, is not known beforehand. Given this lack of characterization, it is challenging to validate whether a system has successfully carried out the user's intended task or instead executed irrelevant actions, potentially as a consequence of compromise. We present Agent Sentry, a runtime defense that learns a bound on an agent's benign execution from prior legitimate executions and flags any action that falls outside this bound. Agent Sentry layers three complementary checks: a structural classifier over the sequence of actions and the provenance of each function's arguments; a deterministic allowlist check over sensitive argument values; and an LLM judge, invoked only on the residual of actions where the first two checks cannot safely decide between a legitimate new request and a carefully crafted injection. We demonstrate the effectiveness of Agent Sentry in AgentDojo and AgentDyn by blocking 94.3% of successful injections while allowing 95.1% of benign executions, without modifying the agent, its tools, or the LLM.
Figures & tables
| Agent | Benign | Attack | Total |
|---|---|---|---|
| Banking | 681 | 1,038 | 1,719 |
| Slack | 572 | 348 | 920 |
| Travel | 609 | 167 | 776 |
| Workspace | 505 | 95 | 600 |
| GitHub | 376 | 165 | 541 |
| DailyLife | 237 | 93 | 330 |
| Layer 1: XGBoost | Layer 1: Rule-Based | |||||||||||||
| Agent | Util. | ABR | FPR | FNR | L1% | L2% | L3% | Util. | ABR | FPR | FNR | L1% | L2% | L3% |
| Banking | 97.9 | 98.7 | 2.1 | 1.3 | 98.8 | 0.2 | 1.0 | 96.0 | 100.0 | 4.0 | 0.0 | 82.2 | 0.7 | 17.2 |
| Slack | 97.0 | 99.7 | 3.0 | 0.3 | 96.5 | 1.2 | 2.3 | 95.2 | 97.5 | 4.8 | 2.5 | 44.5 | 17.6 | 37.8 |
| Travel | 97.5 | 99.4 | 2.5 | 0.6 | 98.5 | 0.0 | 1.5 | 95.4 | 100.0 | 4.6 | 0.0 | 59.5 | 9.1 | 31.4 |
| Workspace | 99.4 | 95.8 | 0.6 | 4.2 | 96.7 | 0.7 | 2.6 | 91.0 | 89.5 | 9.0 | 10.5 | 58.4 | 14.2 | 27.3 |
| GitHub | 91.8 | 95.8 | 8.2 | 4.2 | 95.7 | 0.1 | 4.2 | 85.0 | 84.5 | 15.0 | 15.5 | 38.1 | 8.7 | 53.2 |
| Layer 1: XGBoost | Layer 1: Rule-Based | |||||
|---|---|---|---|---|---|---|
| Agent | Util. | ABR | Ambig. % | Util. | ABR | Ambig. % |
| Banking | 96.9 | 98.2 | 1.0 | 94.5 | 100.0 | 17.2 |
| Slack | 95.4 | 100.0 | 2.3 | 91.9 | 97.6 | 37.8 |
| Travel | 96.2 | 100.0 | 1.5 | 94.4 | 100.0 | 31.4 |
| Workspace | 97.6 | 95.2 | 2.6 | 88.9 | 82.8 | 27.3 |
| GitHub | 90.9 | 94.3 | 4.2 | 78.5 | 93.6 | 53.2 |
| Configuration | L3 invocation rate (%) | Latency/trace (s) |
|---|---|---|
| Agent-Sentry | 3.1 | 0.073 |
| Layer 1 + Layer 2 | 0.0 | 0.01 |
| Layer 3 alone | 100.0 | 2.40 |
| Layer 1: XGBoost | Layer 1: Rule-Based | |||
|---|---|---|---|---|
| Agent | Util. | ABR | Util. | ABR |
| Banking | 77.8 | 91.9 | 77.8 | 93.5 |
| Slack | 63.2 | 90.0 | 79.0 | 90.0 |
| Travel | 83.3 | 85.7 | 100.0 | 88.9 |
| Workspace | 73.7 | 98.5 | 89.5 | 98.5 |
| GitHub | 53.9 | 84.1 | 61.5 | 95.2 |
| Layer 1: XGBoost | Layer 1: Rule-Based | |||
|---|---|---|---|---|
| Agent | Util. | ABR | Util. | ABR |
| Banking | 66.7 | 90.3 | 100.0 | 91.9 |
| Slack | 84.2 | 81.4 | 84.2 | 87.1 |
| Travel | 83.3 | 90.5 | 100.0 | 88.9 |
| Workspace | 78.9 | 100.0 | 89.5 | 98.5 |
| GitHub | 53.8 | 90.5 | 76.9 | 90.5 |
| Agent-Sentry | AgentDojo | ||||
|---|---|---|---|---|---|
| Bench | / AgentDyn | Time | |||
| Method | Util. | ABR | Util. | ABR | (s) |
| Agent-Sentry, XGBoost (Partial) | 96.4 | 96.8 | 69.1 | 91.2 | 4.30 |
| Agent-Sentry, Rules (Partial) | 89.3 | 95.3 | 87.1 | 93.2 | 5.46 |
| Agent-Sentry, Rules (Full) | 99.8 | 94.4 | 95.1 | 94.3 | 5.46 |
| Progent | 69.2 | 97.7 | 93.7 | 88.4 | 4.26 |
| Delivery mechanism | Attacks | ABR |
|---|---|---|
| ImportantInstructions | 532 | 91.5 |
| DirectAttack | 78 | 92.3 |
| InjecAgentAttack | 65 | 90.8 |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Feature | Description |
|---|---|
| Control flow | |
| ordinal position | Position among action tools in the execution trace |
| preceding retrievals | Retrieval calls before this tool call |
| preceding actions | Action calls before this tool call |
| retrieval gap | Retrieval calls made since the last preceding action tool call |
| tool diversity | Counts the distinct tool calls made in the preceding chain |
| Argument | Description | |
|---|---|---|
| recipient | money or message recipient | ✓ |
| recipients | list of recipients | ✓ |
| password | account credential | ✓ |
| otp | one time password | |
| ssh_key | SSH public key | ✓ |
| collaborator_email | repository collaborator address | ✓ |
| Detector | What it checks |
|---|---|
| Anomaly detectors (8) | |
| CFG Retrieval Action | The set of retrievals immediately before this action was never observed in benign traces. |
| CFG Action Action | The action that immediately precedes this action was never observed in benign traces. |
| Source Integrity | A sensitive argument’s reported source is untrusted and but does not contain the argument’s value verbatim (cannot verify). |
| DFG Argument Source | A sensitive argument is reported as coming from a tool that has never supplied this argument in observed benign traces. |
| Multi Hop Chain | An action’s argument value reaches the action through more consecutive untrusted retrievals than any benign chain produced observed. |
| Structural signal | Feature side | Detector side |
|---|---|---|
| Preceding retrieval pattern | CFG Retrieval Action | |
| Action-to-action transition novelty | CFG Action Action | |
| Missing precondition retrieval | implicit in | Retrieval Necessity (detector only) |
| Untrusted source on arguments | Source Integrity, DFG Argument Source | |
| Prompt anchoring of argument values | User Prompt Anchor, Trusted Provenance | |
| Untrusted hop depth / chain length | Multi Hop Chain (uses the benign maximum as its Block threshold) |
| Configuration | Layer 3 | Latency |
|---|---|---|
| invocation rate | /trace (s) | |
| Layer 1 + Layer 2 (XGBoost) | 0.0% | 0.01 |
| Layer 1 + Layer 2 (Rule-based) | 0.0% | 0.01 |
| Agent-Sentry (XGBoost) | 3.0% | 0.07 |
| Agent-Sentry (Rule-based) | 31.0% | 0.74 |
| Layer 3 alone | 100.0% | 2.40 |
| Agent | 50/50 | 67/33 | 75/25 | 80/20 |
|---|---|---|---|---|
| Attack Block Rate | ||||
| Banking | 93.5 | 91.9 | 88.7 | 90.3 |
| Slack | 80.0 | 82.9 | 82.9 | 81.4 |
| Travel | 88.9 | 93.7 | 90.5 | 90.5 |
| Workspace | 97.1 | 98.5 | 100.0 | 100.0 |
| GitHub | 88.9 | 87.3 | 90.5 | 90.5 |
| Agent | 50/50 | 67/33 | 75/25 | 80/20 |
|---|---|---|---|---|
| Attack Block Rate | ||||
| Banking | 91.9 | 91.9 | 91.9 | 91.9 |
| Slack | 90.0 | 85.7 | 87.1 | 87.1 |
| Travel | 88.9 | 88.9 | 88.9 | 88.9 |
| Workspace | 98.5 | 98.5 | 98.5 | 98.5 |
| GitHub | 95.2 | 90.5 | 92.1 | 90.5 |
| Agent | Util. | ABR |
|---|---|---|
| Banking | 50.0 | 95.2 |
| Slack | 65.0 | 100.0 |
| Travel | 5.9 | 100.0 |
| Workspace | 52.8 | 100.0 |
| GitHub | 0.0 | 100.0 |
| DailyLife | 0.0 | 99.3 |
| Agent | Util. | ABR |
|---|---|---|
| Banking | 83.3 | 100.0 |
| Slack | 95.0 | 100.0 |
| Travel | 94.1 | 60.3 |
| Workspace | 94.4 | 100.0 |
| GitHub | 86.7 | 88.9 |
| DailyLife | 100.0 | 87.3 |
| Agent | Util. | ABR |
|---|---|---|
| Banking | 89.8 | 100.0 |
| Slack | 81.0 | 100.0 |
| Travel | 9.0 | 97.0 |
| Workspace | 38.9 | 96.8 |
| GitHub | 84.9 | 91.5 |
| DailyLife | 96.7 | 100.0 |
| Agent | Util. | ABR |
|---|---|---|
| Banking | 100.0 | 91.9 |
| Slack | 94.7 | 90.0 |
| Travel | 100.0 | 96.8 |
| Workspace | 100.0 | 100.0 |
| GitHub | 92.3 | 92.1 |
| DailyLife | 86.7 | 100.0 |
| Agent | Util. | ABR | FPR | FNR | F1 |
|---|---|---|---|---|---|
| Banking | 99.6 | 98.7 | 0.4 | 1.3 | 99.1 |
| Slack | 97.2 | 98.1 | 2.8 | 1.9 | 96.0 |
| Travel | 99.8 | 100.0 | 0.2 | 0.0 | 99.7 |
| Workspace | 99.5 | 90.5 | 0.5 | 9.5 | 94.0 |
| GitHub | 92.0 | 96.4 | 8.0 | 3.6 | 89.8 |
| DailyLife | 97.9 | 92.5 | 2.1 | 7.5 | 93.5 |
| Qwen3.5-35B | Qwen2.5-7B | |||
| Agent | Util. | ABR | Util. | ABR |
| Banking | 88.4 | 61.2 | 74.9 | 87.2 |
| Slack | 91.1 | 97.7 | 66.6 | 87.4 |
| Travel | 91.1 | 100.0 | 85.6 | 88.0 |
| Workspace | 88.5 | 96.8 | 72.9 | 53.7 |
| GitHub | 52.4 | 77.6 | 55.6 | 70.9 |