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
+162Lines changed: 162 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,167 @@ 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 that prevents accidental or unwanted destructive operations. This is particularly important when:
70
+
71
+
- Using the CLI in automated environments (CI/CD pipelines)
72
+
- Providing the CLI as a tool to AI agents/LLMs
73
+
- Working in production environments
74
+
- Training new team members
75
+
- Running commands from untrusted scripts
76
+
77
+
### How It Works
78
+
79
+
Safety Mode uses a **hybrid protection approach**:
80
+
81
+
1. **HTTP Middleware Layer** (Primary Protection)
82
+
- Intercepts ALL HTTP requests before they're sent
83
+
- Cannot be bypassed by command-line flags
84
+
- Works automatically for all commands
85
+
- LLM-proof: controlled via environment variable
86
+
87
+
2. **Command-Level Checks** (Better UX)
88
+
- Provides early, user-friendly error messages
89
+
- Catches operations before HTTP requests
90
+
91
+
### Safety Levels
92
+
93
+
Configure via the `SFCC_SAFETY_LEVEL` environment variable:
0 commit comments