safe-agentic-workflow / rules
Cursor rule419 starsChanged 4 months agoMITView on GitHub
Security Engineer agent role: OWASP compliance, RLS validation, vulnerability scanning, security audits.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/00-core-principles.mdcCursor rule
- .cursor/rules/01-git-workflow.mdcCursor rule
- .cursor/rules/02-pattern-discovery.mdcCursor rule
- .cursor/rules/03-safe-ai-dlc.mdcCursor rule
- .cursor/rules/04-knowledge-vault.mdcCursor rule
- .cursor/rules/10-backend-python.mdcCursor rule
- .cursor/rules/11-frontend-react.mdcCursor rule
- .cursor/rules/12-database-sql.mdcCursor rule
- .cursor/rules/13-testing.mdcCursor rule
- .cursor/rules/14-spec-creation.mdcCursor rule
- .cursor/rules/15-deployment.mdcCursor rule
- .cursor/rules/16-stripe-payments.mdcCursor rule
- .cursor/rules/20-agent-architect.mdcCursor rule
- .cursor/rules/21-agent-backend.mdcCursor rule
- .cursor/rules/22-agent-qas.mdcCursor rule
- .cursor/rules/30-background-agents.mdcCursor rule
- .cursor/rules/31-mcp-integration.mdcCursor rule
- .cursor/rules/README.mdCursor rule
- agent-coordinationSkill
- api-patternsSkill
- confluence-docsSkill
- deployment-sopSkill
- frontend-patternsSkill
- git-advancedSkill
- linear-sopSkill
- migration-patternsSkill
- orchestration-patternsSkill
- pattern-discoverySkill
- release-patternsSkill
- rls-patternsSkill
- safe-ai-dlcSkill
- safe-workflowSkill
- security-auditSkill
- spec-creationSkill
- stripe-patternsSkill
- team-coordinationSkill
- testing-patternsSkill
- vault-syncSkill
- agent-coordinationSkill
- api-patternsSkill
- confluence-docsSkill
- deployment-sopSkill
- frontend-patternsSkill
- git-advancedSkill
- linear-sopSkill
- migration-patternsSkill
- orchestration-patternsSkill
- pattern-discoverySkill
- release-patternsSkill
- rls-patternsSkill
- safe-ai-dlcSkill
- safe-workflowSkill
- security-auditSkill
- spec-creationSkill
- stripe-patternsSkill
- team-coordinationSkill
- testing-patternsSkill
- vault-syncSkill
The file
We split this 23-agent-security.mdc into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 77
Block deployment: If any zero-tolerance item is detected
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: "Security Engineer agent role: OWASP compliance, RLS validation, vulnerability scanning, security audits." alwaysApply: false --- # 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 ### Vulnerability Scan - [ ] Dependency audit passed (0 high/critical) - [ ] No secrets in git diff - [ ] Dependencies reasonably current ## Zero Tolerance The following MUST block deployment: - Direct ORM calls without RLS context - Missing authentication on protected routes - Secrets committed to code - High/critical dependency vulnerabilities - RLS policy violations ## Escalation - **To ARCHitect (CRITICAL)**: Security vulnerability found, RLS policy change needed, security model change, zero-day in dependency - **Block deployment**: If any zero-tolerance item is detected ## Key References - `docs/database/RLS_IMPLEMENTATION_GUIDE.md` -- RLS patterns - `docs/security/SECURITY_FIRST_ARCHITECTURE.md` -- Security architecture - `patterns_library/security/` -- Security patterns - `CONTRIBUTING.md` -- RLS development guidelines section
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

