Skip to content

feat: add safe agents and workflow commands#18

Merged
terisuke merged 1 commit intodevfrom
codex/issue-5-safe-agents
Apr 3, 2026
Merged

feat: add safe agents and workflow commands#18
terisuke merged 1 commit intodevfrom
codex/issue-5-safe-agents

Conversation

@terisuke
Copy link
Copy Markdown

@terisuke terisuke commented Apr 3, 2026

Summary

  • add a guarded implement primary agent and read-only review subagent to the packaged guardrail profile
  • add packaged /implement, /review, /ship, and /handoff commands so workflow gates stay explicit and read-only where intended
  • extend guardrail scenario coverage for default-agent routing, command wiring, and permission policy

Verification

  • bun test test/scenario/guardrails.test.ts
  • bun typecheck

Closes #5

Copilot AI review requested due to automatic review settings April 3, 2026 07:34
@terisuke terisuke merged commit c2d85e4 into dev Apr 3, 2026
1 check passed
@terisuke terisuke deleted the codex/issue-5-safe-agents branch April 3, 2026 07:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds safer default workflow primitives to the guardrails distribution by shipping guarded agents plus explicit workflow-gate commands, and extends scenario coverage to verify routing and permission defaults.

Changes:

  • Set implement as the packaged profile’s default primary agent and add a read-only review subagent with restrictive permissions.
  • Add packaged workflow commands: /implement, /review, /ship, /handoff (with review/ship/handoff running as subtasks under the review agent).
  • Extend guardrail scenario tests to assert default-agent routing, command wiring, and key permission decisions.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/opencode/test/scenario/guardrails.test.ts Adds scenario coverage validating shipped agents/commands and expected permission actions.
packages/guardrails/README.md Documents the new safe agents and workflow command gates in the distribution overview.
packages/guardrails/profile/opencode.json Sets default_agent: implement and expands deny rules for risky git/bash patterns at the profile level.
packages/guardrails/profile/commands/ship.md Introduces /ship release-readiness gate command bound to the read-only review subagent.
packages/guardrails/profile/commands/review.md Introduces /review command bound to the read-only review subagent.
packages/guardrails/profile/commands/implement.md Introduces /implement command bound to the guarded primary implement agent.
packages/guardrails/profile/commands/handoff.md Introduces /handoff command bound to the read-only review subagent.
packages/guardrails/profile/agents/review.md Adds the read-only review subagent definition and permissions.
packages/guardrails/profile/agents/implement.md Adds the guarded implement primary agent definition and permissions.
packages/guardrails/profile/AGENTS.md Updates profile guidance to route gating work through read-only workflow commands/agents.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


## Managed deployment

Copy [managed/opencode.json](/Users/teradakousuke/Developer/opencode/packages/guardrails/managed/opencode.json) into the system managed config directory:
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The link target for managed/opencode.json is an absolute path to a developer machine (/Users/...). This will be broken for everyone else and in published docs. Use a repo-relative link (e.g. ./managed/opencode.json or managed/opencode.json) instead.

Suggested change
Copy [managed/opencode.json](/Users/teradakousuke/Developer/opencode/packages/guardrails/managed/opencode.json) into the system managed config directory:
Copy [managed/opencode.json](managed/opencode.json) into the system managed config directory:

Copilot uses AI. Check for mistakes.
- Open risks
- Recommended next step

Default scope is the current uncommitted work unless `$ARGUMENTS` narrows it.
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

This command text says scope defaults unless $ARGUMENTS narrows it, but the template does not include the $ARGUMENTS placeholder. As a result, command hints won’t advertise $ARGUMENTS, and the wording is misleading. Either add $ARGUMENTS to the template (preferred if you want explicit narrowing) or reword to refer to “command arguments” generally.

Suggested change
Default scope is the current uncommitted work unless `$ARGUMENTS` narrows it.
Default scope is the current uncommitted work unless command arguments narrow it.

Copilot uses AI. Check for mistakes.
- Blocking gates
- Next action

Default scope is the current uncommitted work unless `$ARGUMENTS` narrows it.
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

This command text references $ARGUMENTS for narrowing scope, but the template does not include the $ARGUMENTS placeholder. Either include $ARGUMENTS in the template so it’s explicit/advertised via command hints, or adjust the wording to avoid implying a placeholder is present.

Suggested change
Default scope is the current uncommitted work unless `$ARGUMENTS` narrows it.
Scope: $ARGUMENTS
Default scope is the current uncommitted work if `$ARGUMENTS` is not provided.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

guardrails: safe agents and workflow commands

2 participants