T05 · Unauthorized Access and Privilege Escalation
- Location
instructions/agent-patterns.md:222- Finding
Agent file and shell tools operate without enforceable workspace boundaries
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent multi-agent harness builder, but it gives autonomous agents broad file, shell, environment, and git authority without enough enforceable containment.
Install only if you intend to build and run an autonomous local coding harness. Use it in a disposable clone or container, avoid production credentials in the environment, pin dependencies, disable deepcode unless you trust the executable path, and disable or strictly path-scope git commits before using it on an existing repository.
instructions/agent-patterns.md:222Agent file and shell tools operate without enforceable workspace boundaries
instructions/iteration-loop.md:301Generic Git checkpoint helper stages unrelated repository content
instructions/agent-patterns.md:700Configurable Deepcode executable inherits the complete process environment
instructions/agent-patterns.md:634Evaluator verdict logic can pass incomplete contract-result sets
SKILL.md:24Third-party Python dependencies are installed without version or integrity pinning
The harness treats Codex stdout as trusted structured input and feeds it into _parse_codex_eval() to influence pass/fail decisions without strong validation of schema completeness, field bounds, or correspondence to expected criteria. A compromised or manipulated agent output can forge evaluation results, causing the orchestrator to accept incomplete or unsafe implementations and corrupt downstream decision-making.
f"```"
)
output = _run_codex(prompt, agent_cfg, cwd=str(app_dir) if app_dir else None, timeout=600)
return _parse_codex_eval(output, contract, cfg)
def _parse_codex_eval(output: str, contract: SprintContract, cfg: HarnessConfig | None) -> EvalResult:
"""Extract the JSON block from Codex output and build an EvalResult."""
_parse_codex_eval() uses regex extraction over arbitrary model output and then deserializes the first matching JSON-like block, which is brittle and susceptible to malformed, partial, or adversarially crafted content. Because the parsed object directly drives grading logic, an attacker controlling prompt inputs or agent behavior could inject fabricated contract results and rubric scores that mislead the harness.
output = _run_codex(prompt, agent_cfg, cwd=str(app_dir) if app_dir else None, timeout=600)
return _parse_codex_eval(output, contract, cfg)
def _parse_codex_eval(output: str, contract: SprintContract, cfg: HarnessConfig | None) -> EvalResult:
"""Extract the JSON block from Codex output and build an EvalResult."""
match = re.search(r"```json\s*(\{.*?\})\s*```", output, re.DOTALL)
if not match:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
keep_last_evidence_per_sprint: int = 3
write_allowlist: list[str] = field(default_factory=lambda: ["src/**", "package.json", "package-lock.json"])
protected_paths: list[str] = field(default_factory=lambda: [
".git/**", ".env", ".env.*", "node_modules/**", ".next/**",
"dist/**", "build/**", "harness-state/**", "harness-logs/**",
])
git: WorkspaceGitConfig = field(default_factory=WorkspaceGitConfig)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
keep_last_evidence_per_sprint: int = 3
write_allowlist: list[str] = field(default_factory=lambda: ["src/**", "package.json", "package-lock.json"])
protected_paths: list[str] = field(default_factory=lambda: [
".git/**", ".env", ".env.*", "node_modules/**", ".next/**",
"dist/**", "build/**", "harness-state/**", "harness-logs/**",
])
git: WorkspaceGitConfig = field(default_factory=WorkspaceGitConfig)
Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.
harness-state/evidence/sprint-N/screenshots/
Store axe/Lighthouse raw output under:
```text
harness-state/evidence/sprint-N/axe/
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
protected_paths:
- .git/**
- .env
- .env.*
- node_modules/**
- .next/**
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
protected_paths:
- .git/**
- .env
- .env.*
- node_modules/**
- .next/**
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
protected_paths:
- .git/**
- .env
- .env.*
- node_modules/**
- .next/**
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
protected_paths:
- .git/**
- .env
- .env.*
- node_modules/**
- .next/**
Lines L013-L015 state that the skill 'produces a runnable harness' and that 'You are writing the harness, not running inside it.' However, later sections instruct runtime behaviors such as prompting users interactively, running generation/evaluation loops, collecting artifacts, and committing to git. That is an active contradiction in intent documentation, not merely omitted detail.
The instruction to confirm /Users/xzhao/.local/bin/deepcode and the repeated reference to that exact path later in the file prescribe a specific user/home-directory layout. This is a natural-language policy concern because it forces a particular local environment assumption rather than offering a configurable or user-chosen path.
The setup example includes a realistic secret format (export ANTHROPIC_API_KEY=sk-...) without adjacent guidance on secure credential handling. In practice, users may paste real keys into shell history, checked-in scripts, CI logs, or shared transcripts, increasing the chance of credential exposure.
This line tells the user to use cli_path=/Users/xzhao/.local/bin/deepcode, which bakes in a user-specific filesystem location. The language does not present this as optional or environment-specific guidance, so it effectively enforces a particular setup without opt-in.
This markdown file documents that the generator's Codex path runs with --approval-mode full-auto and manages file reads/writes and shell commands internally. Although the behavior is described, there is no explicit caution or user-facing warning about the safety impact of granting autonomous write and command execution capabilities, which could affect user data or system integrity.
The manifest frames this skill as building a Planner→Generator→Evaluator harness or long-running orchestrator, but these lines explicitly describe the generator backend as allowing Codex to perform file reads/writes and shell commands autonomously. While code generation is in scope for such a harness, granting an agent broad shell-command capability is a materially stronger capability than the manifest describes and is not justified in the manifest text itself.
The skill is described as a multi-agent harness/orchestrator, and evaluator behavior would reasonably include assessing outputs, but these lines explicitly state that Codex may run shell commands during evaluation. Shell execution is a broad operational capability not declared in the manifest and is not an obvious requirement of merely orchestrating or evaluating agent work.
This guidance explicitly instructs the harness to run repeated file-writing helpers and automatic git add/git commit operations, but it does not require an explicit user opt-in or warning before modifying project files and repository history. In a long-running autonomous agent context, silent persistence and history mutation increase the risk of unintended changes, committing sensitive files, or polluting an existing repository in ways the user did not authorize.
The evaluator markdown explains that the Codex path can read files and run shell commands such as curl against the app, which may involve network activity and system interaction. The behavior is operationally described but not accompanied by a clear warning about possible privacy or integrity implications.
This markdown file instructs implementers to run git diff via subprocess.run and to save multiple state artifacts to disk, but it does not include any warning that the skill reads repository state and writes persistent files under the project directory. Because SQP-2 applies to markdown files when descriptions omit warnings about behaviors affecting user data or system integrity, this is a qualifying missing-warning issue.
No suspicious patterns detected.