Skip to content

Integration: system prompt defense scanning (prompt-defense-audit) #5

Description

@ppcvote

Context

agent-audit scans agent code for security issues (injection, secrets, MCP config). prompt-defense-audit scans agent system prompts for missing defenses across 12 attack vectors.

These are complementary — one checks the code, the other checks the instructions.

Proposal

Add a system prompt defense scan stage to agent-audit's pipeline:

  1. agent-audit finds system prompt strings in agent code (you already parse LangChain/CrewAI/AutoGen configs)
  2. Extract the prompt text
  3. Run prompt-defense-audit against it (12 vectors, <5ms, zero deps)
  4. Include defense posture score in the audit report

Data

We scanned 1,646 leaked production system prompts from ChatGPT, Claude, Grok, Cursor, and 1,300+ GPT Store apps:

  • 97.8% have no indirect injection defense
  • 92.4% have no role boundary enforcement
  • Average score: 36/100

Full data: research/defense-posture-results.json

Integration

prompt-defense-audit is on npm (npx prompt-defense-audit) and exports a programmatic API:

import { auditWithDetails } from 'prompt-defense-audit'
const result = auditWithDetails(systemPromptText)
// result.score, result.checks, result.grade

Happy to contribute a PR if this direction makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions