engineering-security

A general set of security rules for code that handles user input, identity, permissions, secrets, or sensitive data. The rules apply across programming languages and frameworks and align with the OWASP Top 10, a common application-security risk list.

In plain words
What is it for?
Use them when writing or reviewing authentication, authorisation, API, database, secret-management, and data-processing code.
Why use it?
They reduce common mistakes such as trusting unchecked input, granting too many permissions, or authorising users before verifying who they are.

Cursor rule

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.

agentmods
npx agentmods add rules/adonai-labs/agent-runway/engineering-security
Clone the repo
git clone --depth 1 https://github.com/adonai-labs/agent-runway
Per session 1,032 This file is loaded in full into every session.
When invoked 1,032 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01032 $0.01032
Opus 5 $0.00516 $0.00516
Sonnet 5 $0.00206 $0.00206
Haiku 4.5 $0.00103 $0.00103

Measured 2d ago against content hash 74f123ab095a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

engineering-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 2d 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.

src/core/rules/engineering-security.mdc · 137 lines

How it starts

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

Engineering Security

Universal security principles applied whenever writing or reviewing code that handles input, identity, secrets, or sensitive data.

These principles apply regardless of language, framework, or technology stack.


Validate all input at the boundary

  • Never trust caller-supplied data; validate type, format, range, and length before use
  • Reject invalid input explicitly; do not attempt to sanitise and proceed
  • Validation belongs at the entry point of the system, before any processing

Least privilege

  • Code, services, and users should request only the permissions they need
  • Default to restrictive; require explicit grant for elevated access
  • If a service does not need write access to a database table, it should not have it

Authenticate before authorising

  • Always verify identity before checking permissions
  • Do not allow partial or anonymous access to sensitive operations unless intentional and documented
  • Enforce authentication and authorisation at the boundary; do not rely on callers doing it correctly

Authorise at the resource level

  • Check that the authenticated user is permitted to access the specific resource being requested
  • Do not rely only on role checks; verify resource ownership in business logic
  • Missing authorisation on one endpoint is sufficient for an access control failure

Secrets belong in secrets management

  • Never store secrets in source code, configuration files committed to source control, or environment variables set in code
  • Inject secrets from a secrets store at runtime (vault, environment, or managed identity)
  • Rotate secrets on compromise; prefer short-lived tokens over long-lived credentials

Protect against injection

  • Use parameterised queries or ORM methods for all database access; never concatenate user input into SQL
  • Validate and escape output in rendering contexts; do not trust stored data as safe to render
  • Treat all external input — headers, query parameters, request bodies, file names — as potentially hostile

Read the full file on GitHub · 137 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. 2d ago First seen · 137 lines · 1,032 tokens per session scan A 74f123ab095a

Subscribe to this mod's changes

engineering-security is a cursor rule published in the GitHub repository adonai-labs/agent-runway (2 stars, last pushed 12d ago), licensed MIT. It adds 1,032 tokens to every session, about $0.0052 per session on Opus 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.