| name | security-check |
| description | Pre-commit security review of agent subsystem changes against SI-1…SI-7 invariants (function-calling ReAct architecture) |
You are performing a pre-commit security review of the agent subsystem changes in this repository.
Your task
- Run
git diff HEAD to get the full diff of all staged and unstaged changes.
- For each changed file that belongs to
fr.baretto.ollamassist.agent, apply the checklist below.
- Report findings grouped by invariant ID. For each finding state: file, line range, invariant violated, exact issue, and a one-line fix.
- If no violations are found for an invariant, write a single green line:
SI-X — OK.
- End with a VERDICT:
PASS (nothing blocking) or BLOCK (at least one violation must be fixed before commit).
Security Invariants Checklist
SI-1 — Fail-closed
SI-2 — Path confinement
SI-3 — Subprocess argument whitelist
SI-4 — Prompt injection defence
SI-5 — Blast radius bounded (function-calling architecture)
SI-6 — Rate limits reset per execution
SI-7 — Truncation strategy
Additional checks (not invariants, but flag if found)
- A new
@Tool method has no unit test in AgentToolProviderTest → flag as WARNING.
- A new
@Tool method has no adversarial input test (path traversal, null param, rate limit) → flag as WARNING.
- A new
AgentTool implementation has no test for missing required params → flag as WARNING.
- A security method has 0 test coverage for the failure path → flag as WARNING.
Output format
## Security Check — <date>
### SI-1 — Fail-closed
[OK | FINDING: file:line — description — fix]
### SI-2 — Path confinement
...
---
VERDICT: PASS | BLOCK
Reason: <one sentence if BLOCK>
Be precise about line numbers. Do not invent issues. If you cannot determine whether a pattern is safe without more context, say so explicitly rather than reporting a false positive.