Skip to content

Commit 3b8861f

Browse files
Copilotpelikhan
andcommitted
Update documentation for automatic lockdown determination
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 9a63cbd commit 3b8861f

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

docs/src/content/docs/guides/security.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,23 +250,25 @@ The compiler generates per-tool Squid proxies; MCP egress is forced through ipta
250250

251251
#### Automatic GitHub Lockdown on Public Repositories
252252

253-
When using the GitHub MCP tool in public repositories, lockdown mode is **automatically enabled by default** to prevent accidental data leakage. This security feature restricts the GitHub token from accessing private repositories, ensuring that workflows running in public repositories cannot inadvertently expose sensitive information.
253+
When using the GitHub MCP tool with a custom token (`GH_AW_GITHUB_MCP_SERVER_TOKEN`), lockdown mode is **automatically determined based on repository visibility** to prevent accidental data leakage. This security feature restricts the GitHub token from accessing private repositories when running in public repositories.
254254

255-
**How Automatic Detection Works:**
255+
**How Automatic Determination Works:**
256256

257-
The system automatically detects repository visibility at workflow runtime:
257+
When `GH_AW_GITHUB_MCP_SERVER_TOKEN` is defined, the system automatically determines lockdown mode at workflow runtime based on repository visibility:
258258

259259
- **Public repositories**: Lockdown mode is automatically enabled. The GitHub MCP server limits surfaced content to items authored by users with push access to the repository.
260260
- **Private/internal repositories**: Lockdown mode is automatically disabled since there's no risk of exposing private repository access.
261261
- **Detection failure**: If repository visibility cannot be determined, the system defaults to lockdown mode for maximum security.
262262

263-
**No Configuration Required:**
263+
**When using default `GITHUB_TOKEN`**: Automatic determination is skipped and lockdown defaults to disabled (no restriction).
264+
265+
**Minimal Configuration:**
264266

265267
```yaml wrap
266268
tools:
267269
github:
268-
# Lockdown is automatically enabled for public repos
269-
# No explicit configuration needed
270+
# Lockdown is automatically determined for public repos
271+
# when GH_AW_GITHUB_MCP_SERVER_TOKEN is defined
270272
```
271273

272274
**Manual Override (Optional):**
@@ -287,10 +289,10 @@ Explicitly setting `lockdown: false` in a public repository disables this securi
287289

288290
**Security Benefits:**
289291

290-
- **Prevents token scope leakage**: Even if a GitHub token has access to private repositories, lockdown mode prevents that access from being used in public repository workflows
292+
- **Prevents token scope leakage**: When using a custom token with private repository access, lockdown mode prevents that access from being used in public repository workflows
291293
- **Defense in depth**: Adds an additional layer of protection beyond token scoping
292-
- **Automatic and transparent**: Works without any configuration changes
293-
- **Safe by default**: Failures default to the most secure setting
294+
- **Automatic and transparent**: Works automatically when `GH_AW_GITHUB_MCP_SERVER_TOKEN` is defined
295+
- **Safe by default**: Detection failures default to the most secure setting
294296

295297
See also: [GitHub MCP Tool Configuration](/gh-aw/reference/tools/#github-tools-github) for complete tool configuration options.
296298

docs/src/content/docs/reference/tools.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,16 @@ Setup: `gh aw secrets set GH_AW_GITHUB_TOKEN --value "<your-pat>"`
110110

111111
**Read-Only**: Default behavior; restricts to read operations unless write operations configured.
112112

113-
**Lockdown**: Automatically enabled for public repositories to prevent accidental data leakage. Filters public repository content to items from users with push access. Private repositories are unaffected.
113+
**Lockdown**: Automatically determined based on repository visibility when using a custom token (`GH_AW_GITHUB_MCP_SERVER_TOKEN`). Filters public repository content to items from users with push access. Private repositories are unaffected.
114114

115-
- **Automatic (default)**: Lockdown is automatically enabled for public repositories and disabled for private/internal repositories
116-
- **Manual override**: Explicitly set `lockdown: true` or `lockdown: false` to override automatic detection
115+
- **Automatic (default)**: When `GH_AW_GITHUB_MCP_SERVER_TOKEN` is defined, lockdown is automatically enabled for public repositories and disabled for private/internal repositories
116+
- **Manual override**: Explicitly set `lockdown: true` or `lockdown: false` to override automatic determination
117117

118118
```yaml wrap
119119
tools:
120120
github:
121-
# Option 1: Automatic (recommended) - no configuration needed
122-
# Lockdown automatically enabled for public repos
121+
# Option 1: Automatic (recommended) - determined at runtime
122+
# Lockdown automatically enabled for public repos when GH_AW_GITHUB_MCP_SERVER_TOKEN is set
123123
124124
# Option 2: Explicit override
125125
lockdown: true # Force enable

0 commit comments

Comments
 (0)