Skip to content

Remediation cookbook — top 20 findings with before/after code examples per framework #126

@JBAhire

Description

@JBAhire

Summary

Create a remediation cookbook that shows developers exactly how to fix the most common g0 findings, with framework-specific before/after code examples.

Motivation

g0 findings include a "Fix" line with generic guidance, but developers need concrete code examples. When a developer sees "Shared memory between users [AA-DL-046]", they need to see the exact code change for their framework, not just "Isolate memory per user_id."

Proposed Content

Structure

For each of the top 20 most common findings:

  1. Rule ID and description — what's wrong and why it matters
  2. Risk — real-world attack scenario (1-2 sentences)
  3. Before — vulnerable code snippet (per framework)
  4. After — fixed code snippet (per framework)
  5. Why this works — brief explanation of the fix
  6. Standards — which compliance requirements this addresses

Top 20 Findings to Cover

Goal Integrity

  1. AA-GI-001 — System prompt has no scope boundaries
  2. AA-GI-002 — No role definition in agent instructions
  3. AA-GI-010 — Missing behavioral constraints

Tool Safety
4. AA-TS-002 — Database tool without input validation
5. AA-TS-003 — Shell execution tool without sanitization
6. AA-TS-010 — Tool with overly broad permissions

Data Leakage
7. AA-DL-046 — Shared memory between users
8. AA-DL-001 — PII in agent responses without masking
9. AA-DL-050 — Logging contains sensitive data

Supply Chain
10. AA-SC-001 — MCP server without version pinning
11. AA-SC-010 — Hardcoded credentials in MCP config
12. AA-SC-020 — Unverified skill/tool source

Memory & Context
13. AA-MP-001 — No context window limits
14. AA-MP-010 — Memory persists across sessions without cleanup

Identity & Access
15. AA-IA-001 — No authentication on agent endpoint
16. AA-IA-010 — Missing rate limiting

Human Oversight
17. AA-HO-001 — No human approval for high-risk actions
18. AA-HO-010 — Missing audit trail

Code Execution
19. AA-CE-001 — Unsandboxed code execution
20. AA-CE-010 — No output validation from code execution

Framework Coverage Per Finding

  • Python (LangChain, CrewAI, OpenAI SDK)
  • TypeScript (Vercel AI, MCP, OpenAI SDK)
  • Java (LangChain4j, Spring AI)
  • Go (Go AI patterns)

File to Create

  • docs/remediation-cookbook.md
  • Link from docs/README.md, getting-started.md, and rules.md

Acceptance Criteria

  • 20 findings with before/after code examples
  • At least 2 framework variants per finding
  • Real-world attack scenario for each finding
  • Standards mapping included
  • Linked from docs index and getting-started guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions