unbound-cli 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LOCAL_DEV.md +35 -2
- package/README.md +82 -7
- package/package.json +1 -1
- package/src/commands/policy.js +1704 -212
- package/src/index.js +26 -7
package/LOCAL_DEV.md
CHANGED
|
@@ -68,11 +68,44 @@ node src/index.js login --base-url http://localhost:8000 --api-key <your-key>
|
|
|
68
68
|
node src/index.js whoami
|
|
69
69
|
node src/index.js status
|
|
70
70
|
|
|
71
|
-
# Policies
|
|
71
|
+
# Policies — overview
|
|
72
|
+
node src/index.js policy # overview + docs links
|
|
73
|
+
node src/index.js policy form-data # reference data (must produce output — bugfix)
|
|
72
74
|
node src/index.js policy list
|
|
73
75
|
node src/index.js policy list --type SECURITY --json
|
|
74
76
|
node src/index.js policy get 1
|
|
75
|
-
node src/index.js policy
|
|
77
|
+
node src/index.js policy effective 1
|
|
78
|
+
|
|
79
|
+
# Policy type subcommands
|
|
80
|
+
node src/index.js policy cost --help
|
|
81
|
+
node src/index.js policy model --help
|
|
82
|
+
node src/index.js policy security --help
|
|
83
|
+
node src/index.js policy tool --help
|
|
84
|
+
|
|
85
|
+
# Cost policies
|
|
86
|
+
node src/index.js policy cost list
|
|
87
|
+
node src/index.js policy cost create --name "Test Cost" --monthly-budget 500 --group engg
|
|
88
|
+
node src/index.js policy cost update 5 --monthly-budget 750
|
|
89
|
+
|
|
90
|
+
# Model policies
|
|
91
|
+
node src/index.js policy model create --name "No Opus" --all-models --excluded claude-3-opus
|
|
92
|
+
node src/index.js policy model create --name "Sonnet Only" --allowed claude-3-5-sonnet
|
|
93
|
+
|
|
94
|
+
# Security policies
|
|
95
|
+
node src/index.js policy security create --name "Block PII" --sub-type guardrails \
|
|
96
|
+
--guardrail PII:BLOCK --guardrail Secrets:REDACT
|
|
97
|
+
node src/index.js policy security create --name "Route 429s" --sub-type error-code-routing \
|
|
98
|
+
--error-route 429:gpt-4:claude-3-5-sonnet
|
|
99
|
+
|
|
100
|
+
# Tool policies (separate backend: /api/v1/command-policies/)
|
|
101
|
+
node src/index.js policy tool list
|
|
102
|
+
node src/index.js policy tool families
|
|
103
|
+
node src/index.js policy tool mcp-servers
|
|
104
|
+
node src/index.js policy tool create-terminal --name "Block rm -rf" \
|
|
105
|
+
--command-family filesystem --field command='rm -rf*' --action BLOCK \
|
|
106
|
+
--custom-message "Destructive command blocked."
|
|
107
|
+
node src/index.js policy tool create-mcp --name "Audit Linear writes" \
|
|
108
|
+
--mcp-server Linear --mcp-action-type write --action AUDIT
|
|
76
109
|
|
|
77
110
|
# Users
|
|
78
111
|
node src/index.js users list
|
package/README.md
CHANGED
|
@@ -127,17 +127,92 @@ Scan a device for installed AI coding tools and report findings to Unbound. Uses
|
|
|
127
127
|
|
|
128
128
|
### Policies (Admin only)
|
|
129
129
|
|
|
130
|
+
Unbound has **four** policy types. Each has its own subcommand with guided flag-based create/update. Tool policies live on a separate backend endpoint but are reachable under the same `policy` command tree.
|
|
131
|
+
|
|
132
|
+
Docs: https://docs.getunbound.ai/policies
|
|
133
|
+
|
|
134
|
+
| Type | Subcommand | Purpose | Docs |
|
|
135
|
+
|---|---|---|---|
|
|
136
|
+
| **Cost** | `unbound policy cost` | Monthly budget limits per user group | https://docs.getunbound.ai/policies/cost-policies |
|
|
137
|
+
| **Model** | `unbound policy model` | Control which AI models are available | https://docs.getunbound.ai/policies/model-policies |
|
|
138
|
+
| **Security** | `unbound policy security` | Guardrails (PII, secrets), routing rules | https://docs.getunbound.ai/policies/security-policies |
|
|
139
|
+
| **Tool** | `unbound policy tool` | Shell command and MCP tool controls | https://docs.getunbound.ai/policies/tool-policies |
|
|
140
|
+
|
|
141
|
+
Generic commands (Cost/Model/Security only):
|
|
142
|
+
|
|
130
143
|
| Command | Description |
|
|
131
144
|
|---------|-------------|
|
|
132
|
-
| `unbound policy
|
|
133
|
-
| `unbound policy
|
|
134
|
-
| `unbound policy
|
|
135
|
-
| `unbound policy update <id>` | Update a policy |
|
|
145
|
+
| `unbound policy` | Overview of types and subcommands |
|
|
146
|
+
| `unbound policy list [--type COST\|MODEL\|SECURITY]` | List policies |
|
|
147
|
+
| `unbound policy get <id>` | Get a policy's details |
|
|
136
148
|
| `unbound policy delete <id>` | Delete a policy |
|
|
137
|
-
| `unbound policy form-data` |
|
|
138
|
-
| `unbound policy effective <id
|
|
149
|
+
| `unbound policy form-data` | Reference data: user groups, models, guardrails, tool types, command policies |
|
|
150
|
+
| `unbound policy effective <id> [--user\|--group]` | View effective policies for a user or group |
|
|
151
|
+
|
|
152
|
+
Cost policy examples:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Create a $1,000/month cap for the engg user group
|
|
156
|
+
unbound policy cost create --name "Eng Budget" --monthly-budget 1000 --group engg
|
|
157
|
+
|
|
158
|
+
# Change the budget
|
|
159
|
+
unbound policy cost update 5 --monthly-budget 1500
|
|
160
|
+
|
|
161
|
+
# List just cost policies
|
|
162
|
+
unbound policy cost list
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Model policy examples:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Allow only specific models
|
|
169
|
+
unbound policy model create --name "Sonnet Only" --allowed claude-3-5-sonnet
|
|
170
|
+
|
|
171
|
+
# Allow everything except specific models
|
|
172
|
+
unbound policy model create --name "No Opus" --all-models --excluded claude-3-opus
|
|
173
|
+
|
|
174
|
+
# List all model policies
|
|
175
|
+
unbound policy model list
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Security policy examples:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# Block PII, redact secrets, for the engg group
|
|
182
|
+
unbound policy security create --name "Block PII" --sub-type guardrails \
|
|
183
|
+
--guardrail PII:BLOCK --guardrail Secrets:REDACT --group engg
|
|
184
|
+
|
|
185
|
+
# Default-route gpt-4 traffic to claude-3-5-sonnet
|
|
186
|
+
unbound policy security create --name "Prefer Sonnet" --sub-type default-routing \
|
|
187
|
+
--route gpt-4:claude-3-5-sonnet
|
|
188
|
+
|
|
189
|
+
# Fall back on 429s
|
|
190
|
+
unbound policy security create --name "429 Fallback" --sub-type error-code-routing \
|
|
191
|
+
--error-route 429:gpt-4:claude-3-5-sonnet
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Tool policy examples:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# See what command families and MCP servers are available
|
|
198
|
+
unbound policy tool families
|
|
199
|
+
unbound policy tool mcp-servers
|
|
200
|
+
|
|
201
|
+
# Block destructive shell commands
|
|
202
|
+
unbound policy tool create-terminal --name "Block rm -rf" --command-family filesystem \
|
|
203
|
+
--field command='rm -rf*' --action BLOCK --custom-message "Destructive command blocked."
|
|
204
|
+
|
|
205
|
+
# Audit Linear write operations via MCP
|
|
206
|
+
unbound policy tool create-mcp --name "Audit Linear writes" --mcp-server Linear \
|
|
207
|
+
--mcp-action-type write --action AUDIT
|
|
208
|
+
|
|
209
|
+
# List, get, delete
|
|
210
|
+
unbound policy tool list
|
|
211
|
+
unbound policy tool get <id>
|
|
212
|
+
unbound policy tool delete <id>
|
|
213
|
+
```
|
|
139
214
|
|
|
140
|
-
|
|
215
|
+
Before creating any policy, run `unbound policy form-data` to see available user group names, model names, guardrail names, and existing command policies. The CLI accepts names (e.g. `engg`, `claude-3-opus`, `PII`) and resolves them to backend IDs automatically. You can also pass numeric IDs directly.
|
|
141
216
|
|
|
142
217
|
### Users
|
|
143
218
|
|