agent-security

agent-security is a cursor rule for Cursor from onesimplecode/agent-engineering-standards. It costs 617 tokens per session, scanned A, original, MIT.

A set of security rules for controlling what coding agents may do with tools, files, commands, and data.

In plain words
What is it for?
Use it to design command allowlists, avoid unrestricted file writes, package installs, execution, or network access, and isolate multiple agents with separate credentials and data controls.
Why use it?
It treats tool permissions as security boundaries and limits agents to the smallest required access. It also requires separate protection for both tool authorisation and the data behind shared services.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to design command allowlists, avoid unrestricted file writes, package installs, execution, or network access, and isolate multiple agents with separate credentials and data controls.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/onesimplecode/agent-engineering-standards/agent-security
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/onesimplecode/agent-engineering-standards

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-security

README.md
[![agentmods](https://agentmods.dev/badge/rules/onesimplecode/agent-engineering-standards/agent-security/github.svg)](https://agentmods.dev/rules/onesimplecode/agent-engineering-standards/agent-security)
Your own site
<a href="https://agentmods.dev/rules/onesimplecode/agent-engineering-standards/agent-security"><img src="https://agentmods.dev/badge/rules/onesimplecode/agent-engineering-standards/agent-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-security

Your own site · 80×15
<a href="https://agentmods.dev/rules/onesimplecode/agent-engineering-standards/agent-security"><img src="https://agentmods.dev/badge/rules/onesimplecode/agent-engineering-standards/agent-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 617 This file is loaded in full into every session.
When invoked 617 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00617 $0.00617
Opus 5.5 $0.00247 $0.00247
Sonnet 5.5 $0.00123 $0.00123
Haiku 4.5 $0.00062 $0.00062

Measured 1mo ago against content hash bff8addadf2e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

agent-security scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

examples/cursor-rules/.cursor/rules/agent-security.mdc · 21 lines

How it starts

The opening of the file, as written. The whole thing — 21 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Security

TR-SEC-010 — Agent tool permission grants are a security boundary (least agency)

Permission allowlists for coding agents (e.g. tool-grant or command-allowlist config) are security boundaries, not conveniences: a prompt-injected agent session (TR-SEC-005) can invoke any allowlisted command without human review. Wildcard grants for arbitrary file writes, package installation, unrestricted exec, or unrestricted network access must not be allowlisted; grant the specific command needed instead. This is OWASP's least-agency principle (least privilege extended to what an agent tool can do, how often, and where) applied to agent tooling. Review all agent permission grants at each governance review (TR-GOV-006). Counters MITRE ATT&CK T1059 (Command and Scripting Interpreter) and T1195.002 executed through trusted developer tooling.

TR-SEC-013 — Two-layer isolation for multi-agent tool and data access

When multiple agents share one backing service (a tool surface and the data behind it), isolation must be enforced at two independent layers, not one. Layer one is the tool-registry/authorization scope — distinct credentials per agent, with the server deciding which tools each credential may even invoke; this bounds what is offered to a given agent's own reasoning. Layer two is the data-layer scope — per-agent database roles or equivalent, bounding what is reachable regardless of what the authorization layer believes it has granted. Neither layer is a substitute for the other: a bug in the tool-registry layer (a stray wildcard registration, a misrouted credential map) can hand an agent a tool it should never have received, and the data-layer role is what still blocks the resulting call; a data layer alone, with no tool-registry scope, would still let a compromised or over-broad tool call reach every table a shared credential can see. Extends TR-SEC-010's least-agency principle from single-agent tool grants to multi-agent tool and data boundaries. The most-exposed agent (the one with an external input path) gets the narrowest grant at both layers; the most broadly-privileged agent gets no external egress at all.

Read the full file on GitHub · 21 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 21 lines · 617 tokens per session scan A bff8addadf2e

Subscribe to this mod's changes

agent-security is a cursor rule published in the GitHub repository onesimplecode/agent-engineering-standards (3 stars, last pushed 1mo ago), licensed MIT. It adds 617 tokens to every session, about $0.0025 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.