Skip to content

Commit adabf69

Browse files
ai-gov: update deny behavior
Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
1 parent 629ba8c commit adabf69

3 files changed

Lines changed: 66 additions & 34 deletions

File tree

content/manuals/ai/sandboxes/governance/concepts.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ request is blocked if any effective policy denies it). A deny rule in an
133133
org-wide policy therefore applies to everyone and can't be overridden by a
134134
team-scoped policy, which makes org-wide deny rules useful as guardrails.
135135

136-
Local rules take no part in this evaluation; see [Precedence](#precedence).
136+
Local allow rules take no part in this evaluation. Local deny rules are still
137+
evaluated and layer on top of the organization policy. See
138+
[Precedence](#precedence).
137139

138140
## Precedence
139141

@@ -144,8 +146,10 @@ whether your organization has governance enabled:
144146
[kit-defined network rules](../customize/kits.md#control-network-access)
145147
determine what sandboxes can access.
146148
- Organization governance active: organization rules apply across all developer
147-
machines, and local and kit-defined rules are not evaluated. `sbx policy ls`
148-
hides these inactive rules by default; see
149+
machines. Local and kit-defined allow rules are not evaluated. They can't
150+
be used to loosen org policy restrictions. Local deny rules are still
151+
evaluated and layer on top of the organization policy. `sbx policy ls` hides
152+
inactive rules by default. See
149153
[Monitoring](monitoring.md#showing-inactive-rules) for how to list them.
150154

151155
When organization governance is active, a user's organization policies are

content/manuals/ai/sandboxes/governance/local.md

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ The `sbx policy` command manages network access rules on your local machine.
1111
Rules apply to all sandboxes on the machine when you use the global scope, or
1212
to a single sandbox when scoped by name.
1313

14-
Local rules apply only when your organization doesn't enforce governance:
14+
Local rules interact with organization governance as follows:
1515

1616
- **No org governance**: local rules fully control what sandboxes can access.
17-
- **Org governance active**: the organization policy replaces local policy.
18-
Local rules are inactive, and `sbx policy allow` and `sbx policy deny` have
19-
no effect. To list the inactive local rules, run
20-
`sbx policy ls --include-inactive`. See
17+
- **Org governance active**: organization rules are the primary policy.
18+
Local allow rules are inactive and have no effect. You can't use them to
19+
loosen a restriction the org policy imposes. Local deny rules are still
20+
evaluated and layer on top of the organization policy, so you can further
21+
restrict access beyond what the org policy allows. To list inactive rules,
22+
run `sbx policy ls --include-inactive`. See
2123
[Monitoring](monitoring.md#showing-inactive-rules).
2224

2325
See [Organization policy](org.md) for how organization governance works.
@@ -94,6 +96,18 @@ $ sbx policy allow network --sandbox my-sandbox api.example.com
9496
$ sbx policy deny network --sandbox my-sandbox ads.example.com
9597
```
9698

99+
You can also set per-sandbox deny rules at creation time with `--deny-network`
100+
on `sbx create` or `sbx run`, instead of adding them after the fact:
101+
102+
```console
103+
$ sbx create --deny-network ads.example.com claude .
104+
$ sbx run --deny-network ads.example.com claude
105+
```
106+
107+
Pass the flag multiple times to deny more than one host. Rules added this way
108+
appear in `sbx policy ls <name>` and can be removed with
109+
`sbx policy rm network --sandbox <name> --resource <host>`.
110+
97111
Specify multiple hosts in one command with a comma-separated list:
98112

99113
```console
@@ -163,26 +177,31 @@ $ sbx policy reset --force
163177

164178
## Troubleshooting
165179

166-
### Local rules have no effect
180+
### Local allow rules have no effect
181+
182+
If rules you add with `sbx policy allow` don't change sandbox behavior, your
183+
organization likely has governance enabled. Run `sbx policy ls` to check: if
184+
the output starts with a `Governance:` status line showing `Managed by <org>`,
185+
org governance is active. When it's active, local allow rules are inactive.
186+
You can't use them to loosen restrictions the org policy imposes.
167187

168-
If rules you add with `sbx policy allow` or `sbx policy deny` don't change
169-
sandbox behavior, your organization likely has governance enabled. Run `sbx
170-
policy ls` to check: if the output starts with a `Governance:` status line
171-
showing `Managed by <org>`, org governance is active. When it's active,
172-
the organization policy replaces local policy, so your rules have no effect.
173-
They're hidden from `sbx policy ls` by default; run `sbx policy ls
174-
--include-inactive` to see them with an `inactive` status in the `STATUS`
175-
column.
188+
Inactive allow rules are hidden from `sbx policy ls` by default; run
189+
`sbx policy ls --include-inactive` to see them with an `inactive` status in
190+
the `STATUS` column.
176191

177192
Organization policy can't be supplemented from your machine. To change what
178193
your sandboxes can access, ask your admin to update the organization policy.
179194

195+
Local deny rules are still evaluated under org governance and layer on top of
196+
the org policy. Use them to further restrict access beyond what the org policy
197+
allows.
198+
180199
### A domain is still blocked after adding an allow rule
181200

182201
If a domain remains blocked after you add a local allow rule, your organization
183-
likely enforces governance, which makes local rules inactive. Run `sbx policy
184-
ls` to check whether org governance is active; if the output starts with a
185-
`Governance:` status line showing `Managed by <org>`, it is. Add
186-
`--include-inactive` to confirm your rule shows an `inactive` status. If so, the
187-
block can only be lifted by updating the org policy in Docker Home or via
202+
likely enforces governance, which makes local allow rules inactive. Run `sbx
203+
policy ls` to check whether org governance is active; if the output starts with
204+
a `Governance:` status line showing `Managed by <org>`, it is. Add
205+
`--include-inactive` to confirm your rule shows an `inactive` status. If so,
206+
the block can only be lifted by updating the org policy in Docker Home or via
188207
the [API](/reference/api/ai-governance/).

content/manuals/ai/sandboxes/governance/org.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ aliases:
1010

1111
[Local policies](local.md) give individual developers control over what their
1212
sandboxes can access. Organization policy moves that control to the admin level:
13-
rules apply to sandboxes across the organization,
14-
either to every member or to specific teams. When organization governance is active, it replaces local `sbx policy`
15-
rules entirely — local rules are no longer evaluated and can't be used to
16-
supplement or override the organization policy.
13+
rules apply to sandboxes across the organization, either to every member or to
14+
specific teams. When organization governance is active, local `sbx policy allow`
15+
rules are no longer evaluated and can't be used to loosen org policy
16+
restrictions. Local `sbx policy deny` rules are still evaluated and layer on top
17+
of the organization policy, so developers can further restrict access beyond
18+
what the org allows.
1719

1820
Admins can manage organization policies through the Docker Home UI or
1921
programmatically using the [Governance API](/reference/api/ai-governance/).
@@ -82,9 +84,10 @@ add multiple entries at once, one per line.
8284
For the full syntax reference (exact hostnames, wildcard subdomains, port
8385
suffixes, and CIDR ranges), see [Policy concepts](concepts.md#network-rules).
8486

85-
When organization governance is active, local network rules are not evaluated.
86-
The organization policy is the only policy in effect. `sbx policy ls` hides
87-
these inactive local rules by default. See
87+
When organization governance is active, local network allow rules are not
88+
evaluated — the organization policy controls what developers can access. Local
89+
network deny rules are still evaluated and layer on top of the org policy. `sbx
90+
policy ls` hides inactive rules by default. See
8891
[Monitoring](monitoring.md#showing-inactive-rules) for how to list them and read
8992
the rule view.
9093

@@ -189,11 +192,17 @@ wildcards match.
189192

190193
## Precedence
191194

192-
When organization governance is active, local rules are not evaluated. Only
193-
organization rules determine what is allowed or denied,
194-
and they can't be supplemented or overridden from a developer's machine. The
195-
same applies to filesystem policies: organization rules replace local behavior
196-
entirely. For how a user's organization policies are evaluated together, see
195+
When organization governance is active, local allow rules are not evaluated.
196+
Only organization rules determine what access is permitted, and local allow
197+
rules can't loosen those restrictions. The same applies to filesystem policies:
198+
local filesystem allow rules are replaced by organization rules entirely.
199+
200+
Local deny rules are still evaluated for network access and layer on top of
201+
the organization policy. Developers can use `sbx policy deny` to further
202+
restrict network access beyond what the org policy allows, even when governance
203+
is active.
204+
205+
For how a user's organization policies are evaluated together, see
197206
[Policy concepts](concepts.md#rule-evaluation).
198207

199208
To unblock a domain when organization governance is active, update the rule in

0 commit comments

Comments
 (0)