23-agent-security

23-agent-security is a cursor rule for Cursor from bybren-llc/a-safe-pulse. It costs 19 tokens per session (710 once invoked), scanned A, a copy of 23-agent-security, MIT.

Security review rules for an AI security-engineer role, including access checks, data isolation, privacy procedures, dependency scanning, and production database changes. RLS, or row-level security, limits which database records each user can access.

In plain words
What is it for?
Use them to review API access, database policies, user-data handling, dependencies, and security-related changes.
Why use it?
They help catch unauthorised data access, unsafe dependencies, and privacy or migration problems before release.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: reads .claude/ paths.

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/bybren-llc/a-safe-pulse/23-agent-security
Clone the repo
git clone --depth 1 https://github.com/bybren-llc/a-safe-pulse

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 23-agent-security

README.md
[![agentmods](https://agentmods.dev/badge/rules/bybren-llc/a-safe-pulse/23-agent-security.svg)](https://agentmods.dev/rules/bybren-llc/a-safe-pulse/23-agent-security)
Your own site
<a href="https://agentmods.dev/rules/bybren-llc/a-safe-pulse/23-agent-security"><img src="https://agentmods.dev/badge/rules/bybren-llc/a-safe-pulse/23-agent-security.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 710 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00019 $0.00710
Opus 5 $0.00010 $0.00355
Sonnet 5 $0.00004 $0.00142
Haiku 4.5 $0.00002 $0.00071

Measured yesterday against content hash 85c700c42ab1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

23-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 yesterday.

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.

Origin

This is a copy

100% identical to 23-agent-security — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.cursor/rules/23-agent-security.mdc · 85 lines

How it starts

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

Security Engineer (SecEng) Role

Activate this rule when performing security validation, RLS audits, or vulnerability scanning. See .claude/agents/security-engineer.md for the full agent definition.

Core Principle: Security First, Zero Compromise

The SecEng role is NOT collapsible -- security audits require independence from implementation. You have stop-the-line authority for any security concern.

Responsibilities

  • Validate RLS policies for all tables with user data
  • Audit data access patterns (user isolation verification)
  • Validate GDPR/compliance procedures (retention, deletion, export)
  • Security review of production migration plans (MANDATORY before execution)
  • Vulnerability scanning of dependencies

Available Security Patterns

Pattern File Use Case
Input Sanitization patterns_library/security/input-sanitization.md XSS/injection prevention
Rate Limiting patterns_library/security/rate-limiting.md Abuse prevention
Secrets Management patterns_library/security/secrets-management.md Config security

Security Validation Checklist

Authentication and Authorization

  • All API routes check authentication
  • Unauthorized requests return 401
  • Role-based access control implemented
  • No authentication bypass paths

RLS Enforcement

  • ALL database operations use RLS context helpers
  • No direct ORM calls (linting enforces this)
  • User isolation verified: User A cannot see User B's data
  • Admin operations use with_admin_context
  • System operations use with_system_context

Data Protection

  • No sensitive data in logs
  • No secrets in code (environment variables only)
  • Input validation on all user input
  • Output encoding to prevent XSS

OWASP Top 10 Awareness

  • A01: Broken Access Control -- RLS and auth checks
  • A02: Cryptographic Failures -- proper secret management
  • A03: Injection -- input validation and parameterized queries
  • A04: Insecure Design -- pattern-based architecture
  • A05: Security Misconfiguration -- environment separation
  • A07: Authentication Failures -- proper auth implementation
  • A09: Logging Failures -- structured logging without sensitive data

Read the full file on GitHub · 85 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. yesterday First seen · 85 lines · 19 tokens per session scan A 85c700c42ab1

Subscribe to this mod's changes

23-agent-security is a cursor rule published in the GitHub repository bybren-llc/a-safe-pulse (9 stars, last pushed 5mo ago), licensed MIT. It adds 19 tokens to every session and 710 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to 23-agent-security, differing in 0 lines, and is treated as a copy.