Skip to content

fix: reject disabled agents in CLI validation#3061

Merged
louisgv merged 1 commit intomainfrom
code-health/disabled-agent-bypass
Mar 27, 2026
Merged

fix: reject disabled agents in CLI validation#3061
louisgv merged 1 commit intomainfrom
code-health/disabled-agent-bypass

Conversation

@la14-1
Copy link
Copy Markdown
Member

@la14-1 la14-1 commented Mar 27, 2026

Summary

  • resolveEntityKey() and checkEntity() in commands/shared.ts checked manifest.agents[input] directly, bypassing the disabled filter that agentKeys() applies. This meant spawn cursor hetzner would resolve successfully and proceed to provision a VM, even though cursor is disabled (proprietary protocol, can't route through OpenRouter).
  • Now both functions check the disabled flag and show the disabled_reason to the user before returning null/false.
  • Removed stale "cursor" references from spawn skill templates (spawn-skill.ts, agent-setup.ts) that are injected into child VMs, so child agents don't advertise a disabled agent.
  • Added 5 new tests covering disabled agent rejection in check-entity.test.ts.
  • Patch version bump to 0.27.4.

Test plan

  • All 1955 tests pass (0 failures)
  • Biome lint/format clean (0 errors)
  • New tests verify: checkEntity returns false for disabled agents, resolveAgentKey returns null for disabled agents, enabled agents still work normally

…ceeding

resolveEntityKey() and checkEntity() checked manifest.agents[input] directly,
bypassing the disabled filter in agentKeys(). This let users run `spawn cursor
<cloud>` even though cursor is disabled, wasting time provisioning a VM for an
agent that can't route through OpenRouter. Now both functions check the disabled
flag and show the disabled_reason to the user.

Also removes stale cursor references from spawn skill templates injected into
child VMs.

Agent: code-health
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@louisgv louisgv left a comment

Choose a reason for hiding this comment

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

Security Review

Verdict: APPROVED
Commit: 01e367f

Findings

None - this PR is security-clean.

Changes Reviewed

  • Added disabled agent validation in checkEntity and resolveEntityKey
  • Properly checks for key existence before accessing .disabled property
  • User-friendly error messages with disabled reason
  • Removed cursor from documentation strings (agent now disabled)
  • Comprehensive test coverage added

Security Analysis

  • ✅ No command injection vectors
  • ✅ No credential leaks
  • ✅ No path traversal
  • ✅ No unsafe type assertions
  • ✅ No XSS/injection risks
  • ✅ Proper type narrowing with existence checks
  • ✅ Maintains backward compatibility

Tests

  • bash -n: N/A (no shell scripts modified)
  • bun test: ✅ PASS (1955 pass, 0 fail)
  • biome lint: ✅ PASS (0 errors)
  • Type safety: ✅ No unsafe assertions

-- security/pr-reviewer

@louisgv louisgv added the security-approved Security review approved label Mar 27, 2026
@louisgv louisgv merged commit db77121 into main Mar 27, 2026
6 checks passed
@louisgv louisgv deleted the code-health/disabled-agent-bypass branch March 27, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-approved Security review approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants