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.
npx agentmods add rules/bybren-llc/safe-agentic-workflow/23-agent-securitygit clone --depth 1 https://github.com/bybren-llc/safe-agentic-workflowWrote 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.
[](https://agentmods.dev/rules/bybren-llc/safe-agentic-workflow/23-agent-security)<a href="https://agentmods.dev/rules/bybren-llc/safe-agentic-workflow/23-agent-security"><img src="https://agentmods.dev/badge/rules/bybren-llc/safe-agentic-workflow/23-agent-security.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once 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 |
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 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- 23-agent-security — 100% identical, 0 lines differ
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
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.
- 2d ago First seen · 85 lines · 19 tokens per session scan A 85c700c42ab1
23-agent-security is a cursor rule published in the GitHub repository bybren-llc/safe-agentic-workflow (406 stars, last pushed 1mo 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. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other cursor rules, from other repositories
skill-layered-design
Layered Design — enforce arquitetura estrita Handler→Service→Repository→Model em todos os projetos DARE, independente de linguagem. Inspirado em "Layered Design for Ruby on Rails Applications" de Vladimir Dementyev (Evil Martians).
architecture
FastAPI layer architecture rules — Router → Service → Repository with Protocol injection.
database-migrations
Role: Database Migration Safety Reviewer. Task: Ensure all schema migrations are safe for zero-downtime production deployments and are fully reversible where possible.
schema
Scalable and secure schema design patterns for relational databases, NoSQL, and APIs. / TR: İlişkisel veri tabanları, NoSQL ve API'ler için ölçeklenebilir ve güvenli şema tasarım kalıpları.
database
Cursor rule "database" from ItamarZand88/awesome-agent-conventions, covering database best practices, prisma setup, prisma models, prisma queries and supabase setup.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.