Skip to content

feat(security): PreToolUse guardrail hooks for agent sessions [v0.3.0 — 6/7]#736

Merged
kokevidaurre merged 2 commits intodevelopfrom
v030/security-guardrails
Apr 14, 2026
Merged

feat(security): PreToolUse guardrail hooks for agent sessions [v0.3.0 — 6/7]#736
kokevidaurre merged 2 commits intodevelopfrom
v030/security-guardrails

Conversation

@kokevidaurre
Copy link
Copy Markdown
Contributor

Summary — PR 6 of 7 for v0.3.0 release

Security guardrails for spawned agent sessions.

Changes (1 file)

  • templates/guardrail.json: PreToolUse hook template injected into all spawned Claude sessions. Prevents agents from: destructive commands, force-pushing, publishing packages, accessing secrets directly.

Note: runtime injection logic is in agent-runner.ts (PR #731).

Merge order

Depends on #731-#735. Merge sixth:

  1. ✅ core-refactor (refactor(core): run engine decomposition + context helpers [v0.3.0 — 1/7] #731)
  2. ✅ run-engine (feat(run): workflow rewrite — smart skip, org cycle, wave execution [v0.3.0 — 2/7] #732)
  3. ✅ conversation (feat(conversation): agents talk + use tools [v0.3.0 — 3/7] #733)
  4. ✅ new-commands (feat(commands): review, credentials, goals, log + minor fixes [v0.3.0 — 4/7] #734)
  5. ✅ init-ux (feat(init): demo agent scaffold, what's next guidance [v0.3.0 — 5/7] #735)
  6. → security-guardrails (this PR)
  7. tests-docs

Test plan

  • npm run build passes
  • Review guardrail rules for completeness

Reorganized from 219-commit develop branch for proper review.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces significant enhancements to the squads-cli, including new commands for credentials management, goal tracking, run logging, and cycle reviews. A major architectural shift in the run --org command implements wave-based parallel execution and a structured Plan-Execute-Review-Verify workflow. Additionally, the PR introduces security guardrails for destructive commands, improves context management for agents, and externalizes various prompts and protocols to markdown files. Feedback highlights a critical command injection vulnerability in the credentials command, missing security checks in the guardrail configuration, and inconsistent module imports.

Comment thread src/commands/credentials.ts
Comment thread templates/guardrail.json Outdated
Comment thread src/commands/credentials.ts Outdated
Comment thread src/lib/cognition.ts Outdated
guardrail.json template injected into all spawned Claude sessions.
Prevents agents from running destructive commands, force-pushing,
publishing packages, or accessing secrets directly.

Co-Authored-By: Claude <noreply@anthropic.com>
@kokevidaurre kokevidaurre force-pushed the v030/security-guardrails branch from 15bb8cd to 4c6a333 Compare April 14, 2026 02:52
kokevidaurre pushed a commit that referenced this pull request Apr 14, 2026
Tests added:
- catalog.test.ts: catalog command tests
- dashboard.test.ts: dashboard engine, renderers, loader tests
- services.test.ts: services command tests
- first-run.e2e.test.ts: updated for demo squad scaffold (requires PR #735)
- guardrail.test.ts: guardrail hook tests
- init.test.ts: expanded init command tests
- telemetry.test.ts: telemetry event tests

Docs:
- docs/tier2.md: Tier 2 architecture documentation

Version:
- package.json: bump to 0.3.0

Note: E2E test expects demo squad from init-ux PR #735.
Merge #735 and #736 before this PR.

Co-Authored-By: Claude <noreply@anthropic.com>
Gemini review caught missing publish checks. Agents should never
publish packages — that requires founder approval.

Co-Authored-By: Claude <noreply@anthropic.com>
@kokevidaurre kokevidaurre merged commit 08e646c into develop Apr 14, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant