Harden.run Beats GPT5.5-xhigh on Agent Guards
Harden.run tested SLM and IRM agent guards against hard coding-agent security benchmarks. Here is what mattered.

Harden.run’s “Beating GPT5.5-xhigh for Coding agent security with SLMs and IRM” is a Show HN research-and-product post about guarding AI coding agents while they write and run code. It deals with the awkward security problem that coding agents can edit files, call tools, touch terminals, and sometimes reach services you did not mean to expose. The useful takeaway is simple: agent safety needs runtime boundaries and reviewable evidence, not just a smarter model reading a prompt. Inline reference monitoring is a technique that checks program behavior while it runs, so the guard can respond to actions instead of only reviewing intent.
The claim that caught developers’ attention was not “we prompted a bigger model better.” Harden.run says it post-trained a cybersecurity small language model, changed how it reasons, and paired it with program-analysis controls such as inline reference monitoring, or IRM. As of August 2026, the post says that combination outperformed GPT5.5-xhigh on difficult coding-agent security benchmarks including LinuxArena and SleightBench. For Cursor, Anysphere’s AI code editor, users working through agentic coding and ai coding governance questions, that is a useful shape of answer: make the agent’s boundary observable at the place where work happens.
Follow the action, not just the chat
The interesting part of Harden.run’s post is the shift from “is this response safe?” to “what is the agent actually doing?” That matters because a coding agent can produce harmless-looking text while preparing a risky action in the repo or terminal.
A normal Cursor workflow makes this concrete. You ask the agent to “clean up the local dev database reset script.” The chat is ordinary. The dangerous part is whether the agent edits scripts/reset-db.ts, calls a shell command, or points an MCP server at production credentials.
This is why red-teaming alone feels incomplete. Red-team prompts can find failures, but they do not automatically create a durable control around file writes, shell commands, network access, or database mutations. The trap is treating a good transcript as proof that the next tool call is safe.
Harden.run’s SLM angle is also practical. A small language model is cheaper to run often, which makes it a better candidate for repeated security checks than a large model used only at review time. The hard part, as some developers pointed out in the discussion around the post, is auditability: you still need to know why the guard allowed something, and whether multiple agents are coordinating behavior across separate calls.
See why agent guards are harder than code review
Code review usually sees a patch. Agent guards need to see a patch, a tool call, a filesystem operation, and sometimes an external system request.
Imagine an agent working in a payments service:
- It adds a migration that drops and recreates a table.
- It updates a seed script to write test data.
- It runs a terminal command to verify the change.
- It asks an MCP server for current customer-like records.
Each step might look reasonable alone. Together, they can cross a boundary the developer never intended. That is the security shape Harden.run is pointing at: coding agents craft arbitrary code, and arbitrary code can create new behavior faster than a reviewer can manually model it.
This is also where Cursor’s reviewable IDE workflow helps. You can inspect diffs, pin local rules, and make the agent work inside a repository rather than a blank chat box. But an IDE workflow is not a security boundary by itself. It needs explicit rules about what may be read, written, executed, and connected.
The related lesson from Code Review Habits for AI Code is boring in the best way: review the generated change as software, not as a conversation. Harden.run’s post pushes that one layer lower. Review the action path too.
Put the smallest boundary near the repo
The practical move is not to wait for one universal agent-security answer. Put a small, local boundary near the repo today, then let stronger monitors sit behind it when you have them.
For Cursor users, that boundary usually starts with rules and review habits. A rule can tell the agent which files are sensitive, which commands require human confirmation, and which data sources are off-limits. It will not replace Harden.run-style monitoring, but it gives the agent less room to improvise.
Use an AGENTS.md boundary when the rule should be visible to every coding agent that enters the repo. Use a Cursor rule when you want IDE-native guidance that stays close to the files being edited. Keep both short. A long policy document is easy for humans to admire and agents to blur.
Here is a lightweight example for a service with a local database, migrations, and one MCP-backed internal docs server:
---
description: Security boundary for agent edits in this repository
globs:
- "**/*"
alwaysApply: true
---
# Agent security boundary
- Do not run destructive commands such as `rm -rf`, `dropdb`, `DROP TABLE`, or schema reset commands without explicit human approval in the chat.
- Treat `.env*`, credential files, production config, customer exports, and database dumps as read-protected unless the task explicitly names them.
- Do not modify migration files and run migration commands in the same step. First propose the migration diff, then wait for review.
- MCP tools may be used for documentation lookup only. Do not use MCP tools to fetch customer data, secrets, tokens, or production records.
- Before finishing, list every shell command run and every file outside the requested area that changed.
The trap is making the boundary sound absolute. A repo rule can guide an agent and improve review. It cannot prove that every action was safe, detect every coordinated multi-agent attack, or explain a monitor’s hidden reasoning. That is exactly where the Harden.run work is interesting: it explores controls closer to runtime behavior.
Try it safely before you trust it
Use this as a small experiment, not a belief system. Pick one repo where an agent can do useful work but should not have broad authority.
| Risk before you copy this | Minimal boundary to add | What to review |
|---|---|---|
| Agent rewrites a migration and runs it immediately | Require migration diff review before execution | Changed migration files, command history, local DB state |
| Agent reads secrets while debugging | Mark .env*, dumps, tokens, and production config as protected |
File reads mentioned in final summary and unexpected diff context |
| Agent uses MCP too broadly | Restrict the mcp server to docs or read-only lookups | Tool-call transcript and whether the data source was necessary |
| Agent chains safe steps into a risky outcome | Ask for a final action log, not just a summary | Commands run, files touched, services contacted |
A good test task is something real but reversible: update a validation rule, add a unit test, or refactor a local-only script. Avoid the tempting demo where the agent has full database power. That only proves the agent can move fast, which you already knew.
This sits naturally inside the related training topic, but the point is smaller than a program. Give the agent one job, one repo boundary, and one review receipt.
Common questions
-
Did Harden.run really beat GPT5.5-xhigh?
Harden.run says its post-trained cybersecurity small language model plus IRM-style controls outperformed GPT5.5-xhigh on hard coding-agent security benchmarks. The citable caveat is that this is the project’s own published benchmark evidence, so treat it as a strong claim to inspect rather than an independent industry result.
-
Why use a small language model for security monitoring?
A small language model can be cheaper and faster to run repeatedly around agent actions. That matters because monitoring every file edit, command, or tool call needs a control that can run often, not just a large model that reviews one final answer.
-
Is IRM the same thing as red-teaming?
No. Red-teaming probes a system to find failures, while inline reference monitoring checks behavior during execution. The useful distinction is timing: red-teaming gives you evidence before deployment, and IRM-style controls can help enforce a boundary while the agent is acting.
-
Can Cursor rules replace a product like Harden.run?
No. Cursor rules are a local instruction and workflow boundary, not a full runtime security monitor. They are still worth using because they make sensitive files, dangerous commands, and MCP permissions explicit before an agent starts editing the repo.
-
What is still unsolved here?
Auditability is still the hard edge. A guard needs to explain why it allowed or blocked an action, and security teams eventually need to detect behavior spread across several agents, tool calls, and time windows rather than one isolated request.
Best ways to use this research
- Best for: Developers already letting coding agents edit real repositories, especially when the agent can run shell commands, write migrations, or connect through an mcp server.
- Best first artifact: A short repo-level boundary that names protected files, destructive commands, allowed MCP uses, and the action log expected at handoff.
- Best comparison angle: Compare prompt-only safety, Cursor rules, and runtime monitoring by where each one sees risk: intent, repo context, or executed behavior.
- Best review habit: Ask for a final receipt that lists commands run, files touched, and external tools called. Then verify the diff instead of trusting the prose.
Further reading
- Beating GPT5.5-xhigh for Coding agent security with SLMs and IRM — source
- Cursor — Agent
- Cursor — Rules
- Model Context Protocol — specification
Start with one guarded task
Pick one repo task that is useful, reversible, and slightly security-sensitive. Add the boundary rule, run the agent, and review the action log before you decide how much more freedom it deserves.
One methodology lens
One useful way to read this through our methodology is the Plan step: delegate first-pass decomposition and dependency mapping, review the sequencing and assumptions, and keep ownership of scope and priorities. If that split is still fuzzy, the workflow usually is too.
Related training topics
Related research

AgentCloud Gives Cloud Agents iOS Simulators
AgentCloud connects MCP-compatible coding agents to disposable iOS simulators so app fixes can be tested end to end.

Codex workspace agents need repo rules
Codex workspace agents and Cursor cloud agents need repo rules: scoped boundary files, connector cards, and replay receipts reviewers can check.

Agentic coding governance for engineering teams
Agentic coding governance for engineering teams: the written contracts, decision stubs, scope ledgers, and replay receipts, that keep agent diffs explainable.