You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cli/index.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,32 @@ These flags are available on all commands that interact with B2C instances:
27
27
|`--username`, `-u`|`SFCC_USERNAME`| Username for Basic Auth |
28
28
|`--password`, `-p`|`SFCC_PASSWORD`| Password/access key for Basic Auth |
29
29
30
+
### Safety Mode
31
+
32
+
Safety Mode provides protection against accidental or unwanted destructive operations. This is particularly important when using the CLI in automated environments, CI/CD pipelines, or as a tool for AI agents.
33
+
34
+
| Environment Variable | Values | Description |
35
+
| ---------------------- | ------ | ----------- |
36
+
|`SFCC_SAFETY_LEVEL`|`NONE` (default) | No restrictions |
37
+
||`NO_DELETE`| Block DELETE operations |
38
+
||`NO_UPDATE`| Block DELETE and destructive operations (reset, stop, restart) |
39
+
||`READ_ONLY`| Block all write operations (GET only) |
40
+
41
+
**Example:**
42
+
```bash
43
+
# Prevent deletions in CI/CD
44
+
export SFCC_SAFETY_LEVEL=NO_DELETE
45
+
b2c sandbox create --realm test# ✅ Allowed
46
+
b2c sandbox delete test-id # ❌ Blocked
47
+
48
+
# Read-only mode for reporting
49
+
export SFCC_SAFETY_LEVEL=READ_ONLY
50
+
b2c sandbox list # ✅ Allowed
51
+
b2c sandbox create --realm test# ❌ Blocked
52
+
```
53
+
54
+
Safety Mode operates at the HTTP layer and cannot be bypassed by command-line flags. See the [Security Guide](/guide/security#operational-security-safety-mode) for detailed information.
Copy file name to clipboardExpand all lines: docs/guide/security.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,44 @@ When adding a new dependency that requires build scripts:
64
64
65
65
This project uses [NPM trusted publishers](https://docs.npmjs.com/trusted-publishers) for package publication. Instead of storing long-lived npm tokens, packages are published via GitHub Actions using short-lived OIDC tokens that cannot be extracted or reused.
66
66
67
+
## Operational Security: Safety Mode
68
+
69
+
The CLI includes a **Safety Mode** feature via CLI checks and HTTP middleware that prevents accidental or unwanted destructive operations. This is particularly important when:
70
+
71
+
- Providing the CLI as a tool to AI agents/LLMs
72
+
- Working in production environments
73
+
- Training new team members
74
+
- Running commands from untrusted scripts
75
+
76
+
### Safety Levels
77
+
78
+
Configure via the `SFCC_SAFETY_LEVEL` environment variable:
0 commit comments