Back to skill

Security audit

Red Team

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent red-team debate tool, but it sends user and file content into tool-capable AI coding CLIs without clear isolation or consent boundaries.

Install only if you are comfortable having your questions, context files, and generated debate content processed by the selected AI CLI provider. Avoid using sensitive documents, secrets, customer data, or hostile third-party files unless you run the backend in a constrained sandbox and understand its data-handling behavior.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/red-team.py:109
Finding

Untrusted Prompt Content Is Passed to Tool-Capable Coding Agents Without Isolation

Content
View full analysis
tuple[list[str], str | None]: """Build the CLI command and optional stdin for the given backend.""" combined_prompt = f"{system}\n\n---\n\n{user_msg}" if backend == "claude": return [ "claude", "--print", "--model", model, "--output-format", "text", "--no-session-persistence", "--append-system-prompt", system, user_msg, ], None elif backend == "codex": # Codex exec reads prompt from positional arg or stdin return [ "codex", "exec", "--model", model, "--quiet", combined_prompt, ], None elif backend == "gemini": # Gemini CLI: prompt as positional arg return [ "gemini", "-p", combined_prompt, ], None ``` ```python def call_agent(system: str, user_msg: str, label: str, model: str = "sonnet", backend: str = "claude") -> str: """Call a coding agent CLI with a system prompt and user message.""" print(f" ⏳ {label}...", end=" ", flush=True) t0 = time.time() cmd, stdin_data = _build_cmd(backend, system, user_msg, model) try: result = subprocess.run( cmd, capture_output=True, text=True, input=stdin_data, timeout=180, ) ``` ```python def run_debate(question: str, persona_keys: list[str], personas: dict, rounds: int, context: str, model: str, backend: str = "claude") -> str: ctx_block = f"\n\n## Additional Context\n{context}" if context else "" # . ...[truncated 5186 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill instructs the agent to execute a local Python script, read optional context files, and write reports, but it declares no explicit tool scope or permission boundaries. That creates unnecessary ambient authority: an agent may invoke shell, read arbitrary user-supplied paths, and write output files without a transparent allowlist, increasing the chance of unintended file access or command execution in normal use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation guidance uses very broad phrases like 'red team,' 'stress test,' 'devil's advocate,' and especially 'what could go wrong,' which can match common conversational requests outside the user's intent to invoke this skill. In a skill that triggers shell execution and file operations, overbroad activation raises the risk of accidental invocation, causing unnecessary command execution, report generation, or processing of local files when the user only wanted a normal discussion.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script forwards the user question, generated debate text, and optional context to external AI CLIs without an explicit disclosure or consent checkpoint. In practice, users may paste confidential business plans, regulated data, or internal documents, and this skill's purpose encourages exactly that kind of sensitive strategic content, increasing the likelihood of inadvertent data exfiltration to third-party services.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/red-team.py (reported line 139)May include surrounding context.

python
cmd, stdin_data = _build_cmd(backend, system, user_msg, model)

    try:
        result = subprocess.run(
            cmd,
            capture_output=True,
            text=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/red-team.py (reported line 330)May include surrounding context.

python
# Check backend CLI is available
    backend_info = BACKENDS.get(args.backend, {})
    try:
        subprocess.run(backend_info["check"], capture_output=True, timeout=10)
    except FileNotFoundError:
        print(f"Error: '{args.backend}' CLI not found. Install: {backend_info.get('install', 'unknown')}", file=sys.stderr)
        sys.exit(1)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script reads an arbitrary local context file and later includes its contents in prompts sent to external AI backends, but it does not clearly warn the user that file contents may leave the local system. This is dangerous because users may supply internal memos, customer data, or secrets as context for red-team analysis, unintentionally transmitting sensitive file contents to a remote provider.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This code performs a filesystem write when --output is provided. While the path is user-specified and the behavior is expected, there is no pre-write warning, comment, or help text noting that existing files may be overwritten depending on the path chosen.

Content

No source excerpt is available for this finding.