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:
- Discover. Read the command schema with
cybrave-cli capability get. - Dry run. Preview the request with
--dry-run. Nothing is sent, and the device validates the change when it is saved. - Save. Save the change as a pending change.
- Review. Show the diff and whose pending changes the commit includes.
- Approve. You approve the change or request a correction.
- Commit. Publish the change to the running configuration.
- 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.
| Integration | Agents | Setup |
|---|---|---|
| Built-in | Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode | The installer installs the skill. To reinstall, run cybrave-cli skill install --yes |
| Manual | Other agents that load skills from a directory | cybrave-cli skill install --dir <dir> --yes |
| Assisted | Chat apps that cannot run commands | No 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
| Request | Agent action | Approval |
|---|---|---|
| "Is the edge firewall healthy?" | Reads the device overview | None |
| "Show me the security rules on the edge firewall" | Reads the rules | None |
| "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 verification | None |
| "Compare the security rules on the edge and branch firewalls" | Reads both devices and reports the differences | None |
| "Block traffic from 203.0.113.7 on the edge firewall" | Shows the proposed deny rule, then saves it | Before the save |
| "Block traffic from 203.0.113.7 on every firewall" | Lists the target devices, then changes one device at a time | Once for each device |
| "Undo my last change" | Shows the change to reverse, then reverts it | Before 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.
| Operation | Example | Requirement |
|---|---|---|
| Read | List security rules | None |
| Save a change | Create a rule | --yes. Under Publish on save, the save also needs publish permission and is refused while another administrator's changes are pending |
| Commit | Publish pending changes | A scope, --confirm-base-url, and operation confirmation if the device requires it |
| Discard | Drop pending changes | A scope and --confirm-base-url |
| Revert | Reverse a published commit | --yes, operation confirmation if the device requires it, then a commit under Manual |
| Destructive action | Reboot 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.
| Guardrail | Behavior |
|---|---|
| Explicit confirmation | Refuses a state-changing command without its confirmation flag. Sends nothing to the device |
| Target device | Refuses a commit, discard, or destructive action if --confirm-base-url does not match the target |
| Shared pending history | Refuses 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 mode | Reads the Config Publishing mode before a write. Refuses the write if the mode is unknown |
| Truthful state | Reports a write as saved only. Reports the published and applied states separately |
| No automatic retry | Never retries a write. After UNKNOWN_OUTCOME, verify the result before retrying |
| Guided next step | Returns next actions after a write and error.actions after a failure |
| Credential handling | Reads 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.
| State | Command | Effect |
|---|---|---|
| Pending | cybrave-cli config discard | Drops the pending changes. Irreversible |
| Published | cybrave-cli config revert-commit | Saves the inverse as a pending change. Commit it to apply |
Security considerations
- Least privilege. Give the agent a dedicated account. Use
superreaderto inspect andsuperuseronly 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
- Resolve the target device. Ask if it is not named.
- Read the schema with
cybrave-cli capability get <command>. - Preview the change with
--dry-run. This check is client-side. The device validates the change on save. - 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. - Read the result back to verify it.
- Before a commit, run
cybrave-cli config diffandcybrave-cli config draft-commits, and tell the user whose pending changes are included. - 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.