Skip to content

feat(ui): Guardrails tab on Agent Detail (#967) - #992

Merged
vybe merged 1 commit into
devfrom
feature/967-guardrails-tab
Jun 2, 2026
Merged

vybe merged 1 commit into
devfrom
feature/967-guardrails-tab

Conversation

@dolho

@dolho dolho commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the missing UI for GUARD-001 per-agent guardrails (#967). The backend endpoint (GET/PUT /api/agents/{name}/guardrails) shipped without a frontend, so owners could only set max_turns_chat / max_turns_task via curl, /docs, or MCP. This adds an owner-only Guardrails tab to AgentDetail.vue.

Changes

  • stores/agents.js — getGuardrails(name) / setGuardrails(name, guardrails) actions (mirror the resource-limits pattern).
  • components/GuardrailsPanel.vue (new) — owner-only form:
    • max_turns_chat, max_turns_task number inputs, range 1–500
    • blank field = inherit platform default (placeholder 50 (default))
    • Save → toast "Guardrails saved — restart agent to apply", matching the Read-Only / Resource-limit restart pattern
    • light + dark themes; p-6 root wrapper (participates in the Agent Detail: Chat tab content width jumps when switching to/from any other tab #954 panel-width stability set)
    • preserves out-of-scope override keys (execution_timeout_sec, *_deny lists) so the whole-config PUT doesn't wipe values set via API
  • views/AgentDetail.vue — import, owner-gated tab (can_share && !is_system) + content block.

Acceptance criteria

  • New Guardrails tab, owner-only (hidden for non-owners)
  • Form bound to GET/PUT /api/agents/{name}/guardrails
  • max_turns_chat / max_turns_task (1–500), defaults shown as placeholder when unset
  • Save triggers "container restart required" toast (matches Read-Only / Resource pattern)
  • Light + dark themes
  • No regression to the Agent Detail: Chat tab content width jumps when switching to/from any other tab #954 panel-width-stability fix (reuses p-6 wrapper)

Out of scope (per issue)

  • New guardrail keys (only the existing two wired)
  • Platform-default-guardrails admin screen

Verification

  • Both SFCs parse clean; vite build transforms all modules without error.
  • Stack started locally; tab renders and saves against the live endpoint.

Related to #967

🤖 Generated with Claude Code

Adds owner-only Guardrails tab wiring the existing GUARD-001 endpoint
(GET/PUT /api/agents/{name}/guardrails) into AgentDetail.vue. Owners can
set max_turns_chat / max_turns_task (1-500) from the UI instead of curl.

- stores/agents.js: getGuardrails / setGuardrails actions
- components/GuardrailsPanel.vue: owner-only form, blank = inherit
  platform default (placeholder 50), restart-required toast matching the
  Read-Only / Resource-limit pattern, light + dark themes. Preserves
  out-of-scope override keys (execution_timeout_sec, *_deny lists) so the
  whole-config PUT doesn't wipe API-set values.
- AgentDetail.vue: import, owner-gated tab + content block, p-6 wrapper
  (panel-width stability set, #954)

Related to #967

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@dolho
dolho requested a review from vybe June 1, 2026 08:31
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Validated: backend contract parity (keys + 1-500 range match _GUARDRAILS_NUMBER_BOUNDS), owner-gating correct, symbols resolve, security clean. APPROVE.

@vybe
vybe merged commit a1bb0f0 into dev Jun 2, 2026
14 checks passed
vybe pushed a commit that referenced this pull request Jun 2, 2026
Document the end-to-end guardrails safety layer: backend
router/service/DB, owner-only Guardrails tab in Agent Detail
(GuardrailsPanel.vue, #967/#992), AGENT_GUARDRAILS env injection on
create/restart, root-owned runtime config merge at boot, and Claude Code
PreToolUse/PostToolUse hook enforcement plus --max-turns/--disallowedTools
CLI budgets. Register in feature-flows index (Recent Updates +
Configuration & Settings).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.

2 participants