security-review
Skill451 starsChanged 20 days agoApache-2.0View on GitHub
10-category security checklist for agent-core: secrets, input validation, sandbox, and prompt injection.
- Reads credentials
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 167 edited versions we read keep these.
4
Distinctive
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 57
Rule: Use parameterized queries for all database operations.
- Distinctive: line 109
Rule: All mutating requests include validation.
- Distinctive: line 144
Rule: All dependencies scanned before merging PRs.
- Distinctive: line 180
Before marking a security-sensitive PR as ready for review, run through all 10 categories above.
“Common” is measured: kept by at least 6 in 10 of the 167 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security Review
Comprehensive security checklist for agent-core. Run through all 10 categories before any security-sensitive change or PR.
See .claude/rules/python/security.md for tool-specific guidance (bandit, pip-audit).
See .claude/rules/security.md for credential, sandbox, and shell execution rules.
1. Secrets Management
Rule: Credentials never enter source code.
- No API keys, tokens, or passwords hardcoded in
.pyfiles - All secrets loaded from environment variables via
os.getenv() .envfiles not committed (already in.gitignore— do not remove)settings.jsondeny rules blockRead(./.env)andRead(./**/secrets/**)- Test files use mock defaults:
os.getenv("KEY", "mock-key-for-tests")
# Bad
API_KEY = "sk-1234567890abcdef"
# Good
import os
API_KEY = os.getenv("OPENAI_API_KEY") # Must be set in environment2. Input Validation
Rule: Validate all external input before use.
- User-supplied file paths checked with
safe_pathutilities - Paths rejected if they contain
..or resolve outside allowed scope - Shell commands constructed via parameterized APIs, not string concatenation
- URL parameters and query strings sanitized before use
For sys_operation:
from openjiuwen.core.common.security import safe_path
def execute_command(user_path: str, working_dir: Path) -> None:
validated = safe_path(user_path, allowed_base=working_dir)
if validated is None:
raise SecurityError(f"Path outside allowed scope: {user_path}")
# Proceed with validated path3. SQL Injection
Rule: Use parameterized queries for all database operations.
- No string interpolation in SQL:
f"SELECT * FROM {table}"is forbidden - All SQL uses parameterized placeholders:
"WHERE id = ?", (id,) - Table/column names validated against an allowlist if dynamic
# Bad
cursor.execute(f"SELECT * FROM {table_name} WHERE id = {user_id}")
# Good
cursor.execute(
"SELECT * FROM sessions WHERE id = ?",
(session_id,)
)4. Authentication and RBAC
Rule: Access control must be enforced server-side, not just client-side.
- All agent capabilities gated behind permission checks in
core/security/ - Guardrails in
openjiuwen/core/security/verify permissions before execution - No capability bypassed by missing checks on alternate code paths
- Resource limits enforced (rate limiting, concurrent request limits)
5. Prompt Injection
Rule: openjiuwen/harness/prompts/ must guard against injected user content.
- User-provided strings never concatenated directly into system prompts without sanitization
- Prompt templates use placeholder isolation (separate user content from instruction)
- Rail outputs validated before being passed to downstream components
- The security rail (
openjiuwen/harness/rails/) correctly blocks dangerous patterns
Prompt injection is agent-core's most unique security concern. Attackers may try to inject instructions into conversation history to manipulate agent behavior:
# Bad — user content injected into system prompt
system_prompt = f"You are a helpful assistant. User said: {user_message}"
# Good — user content kept in separate context slot
system_prompt = SYSTEM_INSTRUCTIONS
context = {
"user_message": sanitize_for_display(user_message),
"conversation_history": conversation,
}6. CSRF / Request Validation
Rule: All mutating requests include validation.
core/session/validates that requests originate from legitimate sessions- Session IDs are non-guessable (use
secrets.token_urlsafe()) - Session state changes are idempotent or protected by transaction semantics
- No state-modifying operations accessible without session context
7. Rate Limiting
Rule: Protect core/runner/ and core/runner/ resources from exhaustion.
Runner.resource_mgrenforces limits on concurrent agent executions- Memory usage bounded for long-running sessions
- Compaction triggers prevent unbounded context growth
- Tool call frequency limits enforced per session
8. Sensitive Data in Logs
Rule: Logs must not expose credentials, tokens, or sensitive data.
- No API keys, tokens, or passwords in log output
- Use structured logging with explicit field names, not f-string interpolation
- Error messages do not include sensitive user data
openjiuwen.core.common.loggingused instead ofprint()
# Bad
logger.info(f"Authenticated user {user_id} with token {token}")
# Good
logger.info("User authenticated", extra={"user_id": user_id})9. Dependency Security
Rule: All dependencies scanned before merging PRs.
- New dependencies reviewed for known CVEs:
pip-audit - New network-facing dependencies reviewed for security implications
bandit -r openjiuwen/ -llpasses (no HIGH/CRITICAL findings)- Third-party code in
core/sys_operation/andcore/security/minimized
# Run before merging dependency changes
pip-audit
bandit -r openjiuwen/ -ll10. Sandbox Isolation
Rule: core/sys_operation/sandbox/ must provide genuine isolation.
- File operations respect path scoping (no escape via
../) - Shell execution runs in a restricted environment
- Network access is explicitly allowed/denied, not default-open
- Cleanup runs after every operation, even on failure
- Interrupt/confirm flows preserved for user-facing operations
For sandbox implementations, verify:
# Path isolation
def sandbox_read(path: Path, allowed_base: Path) -> str:
resolved = (allowed_base / path).resolve()
if not resolved.is_relative_to(allowed_base):
raise SecurityError(f"Escape attempt: {path}")
return resolved.read_text()Pre-Review Checklist
Before marking a security-sensitive PR as ready for review, run through all 10 categories above. Document the review in the PR description:
Security Review
===============
Secrets: PASS (no hardcoded credentials)
Input Val: PASS (safe_path used for all user paths)
SQL Injection: PASS (parameterized queries only)
Auth/RBAC: PASS (guardrails enforce permissions)
Prompt Inject: PASS (user content isolated from system prompts)
CSRF: PASS (session IDs are non-guessable)
Rate Limiting: PASS (resource_mgr enforces limits)
Log Safety: PASS (no credentials in structured logs)
Dependencies: PASS (bandit + pip-audit clean)
Sandbox: PASS (path scoping verified)For changes to core/security/, core/sys_operation/, or
openjiuwen/extensions/sys_operation/sandbox/, request a dedicated
security review from a second reviewer.
Other versions192 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 192
- affaan-m/ECC★ 246ksame name
- github/awesome-copilot★ 41ksame name
- langfuse/langfuse★ 37ksame name
- nearai/ironclaw★ 13ksame name
- joe-bell/cva★ 6.9ksame name
- doorkeeper-gem/doorkeeper★ 5.5ksame name
- compozy/compozy★ 2.8ksame name
- getsentry/sentry-python★ 2.2ksame name
- trycompai/comp★ 2.1ksame name
- xu-xiang/everything-claude-code-zh★ 1.9ksame name
182 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use dependency-cve-sweep, fleet-standard-adoption and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
berntpoppSkilldependency-cve-sweep
Use when handling Dependabot PRs, CodeQL/Trivy alerts, or doing a routine dependency/CVE sweep for this repo.
Also in 12 projects that use this
berntpoppSkillfleet-standard-adoption
Use when bringing this repo into compliance with a GeneFoundry fleet standard (tool-naming, response-envelope, container-hardening, versioning, MCP transport, or logging) or closing its tracking issue.
Also in 12 projects that use this
niloykumarbarmanSkillagent-sort
Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.
Also in 12 projects that use this
ysyecustSkillbrand-discovery
Use when a brand needs to discover or articulate its identity through structured multi-session interviews. Covers purpose, positioning, audience, personality, voice, narrative, and founder-brand tension across 8 modules using laddering, 5 Whys, and projective techniques. Produces a resumable session with disk-persisted state and a master brandbook (90_SYNTHESIS.md).
Also in 5 projects that use this
InfopibeSkilleverything-claude-code
Also in 11 projects that use this
royaluniondesign-sysSkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 10 projects that use this
- +2 more from berntpopp
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- harness-provider-integrationSkill
- python-patternsSkill
- python-testingSkill
- verification-loopSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

