Skip to content

bug(templates): sage/scout/scribe ship no .gitignore — every agent created from them is born with 4 hard security findings #1908

Description

@obasilakis

Summary

Three visible, user-pickable bundled templates — sage, scout, scribe — ship no .gitignore. Every agent created from them is born failing four hard (must-fix) security checks of the compatibility spec (#668), before the user has done anything.

The platform grades agents against docs/agent-validation-spec.md, but nothing grades the templates the platform itself ships.

Evidence

Compatibility report for a freshly created agent (no user changes, agent healthy and running):

status: issues | hard: 5  soft: 8  info: 6

HARD S-001 [Security] .env is not excluded in .gitignore — credentials may be committed
HARD S-002 [Security] .mcp.json is not excluded in .gitignore — injected credentials may be committed
HARD S-004 [Security] .claude/projects/ is not excluded — Claude Code session history would be committed
HARD S-005 [Security] .trinity/ is not excluded — platform runtime state would be committed
soft F-003 [File Structure] .gitignore is missing — secrets may be committed on first sync
soft S-006/S-007/S-008 [Security] runtime dirs / content/ / wildcard secret patterns not excluded

All four hard findings share one root cause: F-003, no .gitignore in the template.

Survey of config/agent-templates/:

  • 11 of 31 bundled templates ship no .gitignore
  • Of those, 3 are visible (not hidden: true) and therefore user-pickable: sage, scout, scribe
  • Each ships only .claude/, CLAUDE.md, template.yaml
  • The other 8 are hidden internal fixtures (e.g. test-echo), out of scope here
  • The majority of bundled templates (aero-*, claim-verifier, …) do ship a .gitignore, so this is drift, not a missing convention

Impact

The stated risk in the checks themselves is credentials being committed — .env and .mcp.json both live in the agent home, which is the git repo root (#1703). Any agent from these three that later gets git sync enabled has no protection from the template; it depends entirely on the fleet-wide .gitignore merge in git_service._GITIGNORE_PATTERNS at sync time.

Secondary: a new user's first agent shows a red "5 must-fix" banner on the Overview tab, which reads as "the platform shipped me something broken."

Mitigation that already exists

All four hard findings are in the auto-fixable gitignore set (POST /api/agents/{name}/compatibility/fix, #668), so they are one click from resolved per agent. That is probably why this went unnoticed — but it is a per-agent manual step for a defect shipped in the template.

Proposed fix

  1. Add a .gitignore to sage, scout, scribe, matching the one the compliant bundled templates already use.
  2. Extend the CI guard proposed in refactor(ci): validate every bundled template.yaml declares only what it ships #1655 with one more assertion: every non-hidden bundled template satisfies the hard-severity checks of docs/agent-validation-spec.md that are statically decidable (the .gitignore set and T-002 naming). refactor(ci): validate every bundled template.yaml declares only what it ships #1655 already establishes that no CI validates template.yaml at all and that the runtime compatibility checks are advisory and "cannot fail a build" — this is the same hook, one assertion wider.

Acceptance Criteria

Notes

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions