Skip to content

feat: prompt injection scanning of repo context files before container launch #76

@eshulman2

Description

@eshulman2

Problem

Before spawning a container, Forge passes the workspace directly to the agent with no inspection of context files. If a malicious actor places an injection payload in CLAUDE.md, AGENTS.md, or similar files in a target repo, the agent will process it without any warning or block.

Proposed solution

Before ContainerRunner.run() spawns the container, walk the workspace for files matching: CLAUDE.md, AGENTS.md, .cursorrules, SKILL.md.

Run a heuristic scanner over their content looking for known injection patterns (e.g. ignore previous instructions, you are now, attempts to call unexpected tools).

  • On critical findings: log a WARNING and optionally block (configurable via FORGE_INJECTION_SCAN_MODE=warn|block)
  • Log findings at worker level with ticket key for traceability

Reference

Learned from fullsend, which implements a two-pass scan (host-side before upload, sandbox-side after): internal/security/, internal/cli/run.go:scanRepoContextFiles()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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