Skip to Content
Cybrave OS

Use with AI Agents

Let an AI agent operate Cybrave CLI within CLI-enforced guardrails, and approve each change before it is published.

An AI agent operates Cybrave CLI with the same commands as an administrator. The CLI enforces the guardrails. The agent skill provides the workflow.

Start here once the CLI can reach the intended device and your agent has loaded the skill. For installation, a device profile, and a first read-only command, follow the CLI Quickstart.

How it works

Check the device’s Config Publishing mode first. In on-save mode, review the proposed change and obtain approval before saving, since the save publishes it. The following sequence applies to configuration changes in manual mode:

  1. Discover. Read the command schema with cybrave-cli capability get.
  2. Dry run. Preview the request with --dry-run. Nothing is sent, and the device validates the change when it is saved.
  3. Save. Save the change as a pending change.
  4. Review. Show the diff and whose pending changes the commit includes.
  5. Approve. You approve the change or request a correction.
  6. Commit. Publish the change to the running configuration.
  7. Verify. Confirm the apply state before reporting success.

Supported agents

Support depends on the agent that runs the commands, not on the model behind it.

IntegrationAgentsSetup
Built-inClaude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCodeThe installer installs the skill. To reinstall, run cybrave-cli skill install --yes
ManualOther agents that load skills from a directorycybrave-cli skill install --dir <dir> --yes
AssistedChat apps that cannot run commandsNo skill. Use the prompt in Overview and run the commands yourself

Models. A supported agent can run on any model that it supports, including DeepSeek, Doubao, Kimi, Qwen, and GLM. Select the model in the agent settings. The skill and the CLI guardrails are unaffected. Agents from these vendors that read the shared skill directory ~/.agents/skills can also use the skill. Install it there with cybrave-cli skill install --dir $HOME/.agents/skills --yes.

Example requests

RequestAgent actionApproval
"Is the edge firewall healthy?"Reads the device overviewNone
"Show me the security rules on the edge firewall"Reads the rulesNone
"Which rule would a session from 198.51.100.20 to 10.1.2.10 on port 443 match?"Asks for the zones if the rules use them, then runs policy verificationNone
"Compare the security rules on the edge and branch firewalls"Reads both devices and reports the differencesNone
"Block traffic from 203.0.113.7 on the edge firewall"Shows the proposed deny rule, then saves itBefore the save
"Block traffic from 203.0.113.7 on every firewall"Lists the target devices, then changes one device at a timeOnce for each device
"Undo my last change"Shows the change to reverse, then reverts itBefore the revert

Name the target device in every request.

Permission model

Requirements increase with impact. Run cybrave-cli capability get <command> to see the requirement for a command.

OperationExampleRequirement
ReadList security rulesNone
Save a changeCreate a rule--yes. Under Publish on save, the save also needs publish permission and is refused while another administrator's changes are pending
CommitPublish pending changesA scope, --confirm-base-url, and operation confirmation if the device requires it
DiscardDrop pending changesA scope and --confirm-base-url
RevertReverse a published commit--yes, operation confirmation if the device requires it, then a commit under Manual
Destructive actionReboot the device--confirm-base-url, and operation confirmation if the device requires it

Guardrails enforced by the CLI

These guardrails apply to every caller, regardless of the agent's instructions. The device enforces the shared pending history rule. The CLI enforces the others.

GuardrailBehavior
Explicit confirmationRefuses a state-changing command without its confirmation flag. Sends nothing to the device
Target deviceRefuses a commit, discard, or destructive action if --confirm-base-url does not match the target
Shared pending historyRefuses to publish another administrator's changes without --include-others-work. Under Publish on save, refuses a save while another administrator's changes are pending
Config Publishing modeReads the Config Publishing mode before a write. Refuses the write if the mode is unknown
Truthful stateReports a write as saved only. Reports the published and applied states separately
No automatic retryNever retries a write. After UNKNOWN_OUTCOME, verify the result before retrying
Guided next stepReturns next actions after a write and error.actions after a failure
Credential handlingReads tokens from standard input or the environment. Stores them in the operating system's credential store

Approvals

The agent requests your approval for the following:

  • Commit. Review the diff and the included changes first.
  • Destructive action. Name the device yourself.
  • Operation confirmation. Provide the one-time code only for the operation you approved.

Undo a change

Every commit records its author and message, so each change is traceable and reversible.

StateCommandEffect
Pendingcybrave-cli config discardDrops the pending changes. Irreversible
Publishedcybrave-cli config revert-commitSaves the inverse as a pending change. Commit it to apply

Security considerations

  • Least privilege. Give the agent a dedicated account. Use superreader to inspect and superuser only to change configuration.
  • Secrets. Provide the token through a file or an environment variable, not in chat. Revoke an exposed token.
  • Data exposure. Data that the agent reads from the device is sent to the AI service.
  • Review. An agent can be wrong. Review every diff before a commit.
  • Config Publishing mode. Under Publish on save (on-save), the default, a change takes effect when it is saved, without a commit, and the device does not request operation confirmation for each save. For a device that an agent changes, set the mode to Manual, or approve every change before the agent saves it.

Instructions for AI agents

Prerequisites

Install the CLI and the skill as described in the CLI Quickstart, and follow the skill. In a sandbox, request network access to the device first.

Without command execution

Write each command in full for the user to run. Ask for the JSON output and decide the next step from it.

Workflow

  1. Resolve the target device. Ask if it is not named.
  2. Read the schema with cybrave-cli capability get <command>.
  3. Preview the change with --dry-run. This check is client-side. The device validates the change on save.
  4. If saving will publish the change, obtain approval before running the command. Run the command with --format json. On a terminal, the default output is a table.
  5. Read the result back to verify it.
  6. Before a commit, run cybrave-cli config diff and cybrave-cli config draft-commits, and tell the user whose pending changes are included.
  7. Report the request, the change, and any remaining work.

Safety rules

  • Never run a destructive action until the user names the device and accepts the impact.
  • Never choose a default device, profile, or first match.
  • Never reuse an approval for another device.
  • Never commit a change that the user has not reviewed.
  • Never publish another administrator's pending changes without telling the user.
  • Never report a change as in effect before verifying that it is published.
  • Never report that no rule matches from an incomplete query. Ask for the missing session fields, such as zones.
  • Never repeat a write after UNKNOWN_OUTCOME. Verify the result first.
  • Never put a token, password, or one-time code on a command line.

Further guidance

The installed skill contains the workflows, recovery steps, and reporting format.