Skip to content

Commit 3f99800

Browse files
authored
Document automatic GitHub lockdown on public repositories (#8189)
1 parent 2a38bbe commit 3f99800

File tree

3 files changed

+62
-3
lines changed

3 files changed

+62
-3
lines changed

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,52 @@ mcp-servers:
248248

249249
The compiler generates per-tool Squid proxies; MCP egress is forced through iptables. Only listed domains are reachable. Applies to `mcp.container` stdio servers only.
250250

251+
#### Automatic GitHub Lockdown on Public Repositories
252+
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.
254+
255+
**How Automatic Detection Works:**
256+
257+
The system automatically detects repository visibility at workflow runtime:
258+
259+
- **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.
260+
- **Private/internal repositories**: Lockdown mode is automatically disabled since there's no risk of exposing private repository access.
261+
- **Detection failure**: If repository visibility cannot be determined, the system defaults to lockdown mode for maximum security.
262+
263+
**No Configuration Required:**
264+
265+
```yaml wrap
266+
tools:
267+
github:
268+
# Lockdown is automatically enabled for public repos
269+
# No explicit configuration needed
270+
```
271+
272+
**Manual Override (Optional):**
273+
274+
You can explicitly set lockdown mode if needed:
275+
276+
```yaml wrap
277+
tools:
278+
github:
279+
lockdown: true # Force enable lockdown
280+
# or
281+
lockdown: false # Explicitly disable (use with caution in public repos)
282+
```
283+
284+
:::caution[Disabling Lockdown in Public Repositories]
285+
Explicitly setting `lockdown: false` in a public repository disables this security protection. Only do this if you fully understand the implications and have other controls in place to prevent data leakage.
286+
:::
287+
288+
**Security Benefits:**
289+
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
291+
- **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+
295+
See also: [GitHub MCP Tool Configuration](/gh-aw/reference/tools/#github-tools-github) for complete tool configuration options.
296+
251297
### Agent Security and Prompt Injection Defense
252298

253299
#### Sanitized Context Text Usage

docs/src/content/docs/reference/frontmatter-full.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,9 @@ tools:
11471147
read-only: true
11481148

11491149
# Enable lockdown mode to limit content surfaced from public repositories (only
1150-
# items authored by users with push access). Default: false
1150+
# items authored by users with push access)
1151+
# Default: Automatically enabled for public repositories, disabled for private/internal repositories
1152+
# Set explicitly to override automatic detection
11511153
# (optional)
11521154
lockdown: true
11531155

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,25 @@ 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**: Filter public repository content to items from users with push access. Private repos unaffected:
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.
114+
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
114117

115118
```yaml wrap
116119
tools:
117120
github:
118-
lockdown: true
121+
# Option 1: Automatic (recommended) - no configuration needed
122+
# Lockdown automatically enabled for public repos
123+
124+
# Option 2: Explicit override
125+
lockdown: true # Force enable
126+
# or
127+
lockdown: false # Explicitly disable (use with caution in public repos)
119128
```
120129

130+
See [Automatic GitHub Lockdown](/gh-aw/guides/security/#automatic-github-lockdown-on-public-repositories) for security implications.
131+
121132
## Playwright Tool (`playwright:`)
122133

123134
Enables containerized browser automation with domain-based access control:

0 commit comments

Comments
 (0)