Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion docs/src/content/docs/reference/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ GitHub Agentic Workflows supports environment variables in 13 distinct contexts:
| **Container** | `container.env` | Container runtime | Container settings |
| **Services** | `services.<id>.env` | Service containers | Database credentials |
| **Sandbox Agent** | `sandbox.agent.env` | Sandbox runtime | Sandbox configuration |
| **Sandbox MCP** | `sandbox.mcp.env` | Model Context Protocol (MCP) gateway | MCP debugging |
| **Sandbox MCP** | `sandbox.mcp.env` | Model Context Protocol (MCP) gateway | MCP gateway configuration |
| **MCP Tools** | `tools.<name>.env` | MCP server process | MCP server secrets |
| **MCP Scripts** | `mcp-scripts.<name>.env` | MCP script execution | Tool-specific tokens |
| **Safe Outputs Global** | `safe-outputs.env` | All safe-output jobs | Shared safe-output config |
Expand Down Expand Up @@ -263,6 +263,22 @@ Environment variables follow a **most-specific-wins** model, consistent with Git

These scopes are independent and operate in different contexts: `engine.env`, `container.env`, `services.<id>.env`, `sandbox.agent.env`, `sandbox.mcp.env`, `tools.<tool>.env`, `mcp-scripts.<tool>.env`.

### `sandbox.mcp.env` validation and transport

Variables under `sandbox.mcp.env` configure the MCP gateway process, but they are not injected into the startup shell script as raw `export NAME=VALUE` lines. Instead, gh-aw transports them through compiler-controlled step environment variables and reconstructs the final gateway container `-e NAME=VALUE` arguments at runtime. This keeps values out of shell interpolation paths and avoids command-injection hazards from special characters.

Names in `sandbox.mcp.env` must match `^[A-Z_][A-Z0-9_]*$`. The internal `GH_AW_MCP_GATEWAY_` namespace is reserved for gh-aw transport metadata and cannot be used for custom variables.

```yaml wrap
sandbox:
mcp:
env:
DEBUG: "1"
LOG_LEVEL: trace
```

Use `sandbox.mcp.env` for gateway-facing configuration only. For MCP server credentials or per-tool settings, prefer `tools.<name>.env` or `mcp-scripts.<name>.env`.

### Override Example

```yaml wrap
Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/docs/reference/threat-detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ safe-outputs:
path: /tmp/gh-aw/threat-detection/
```

**Available Artifacts:** Custom steps have access to `/tmp/gh-aw/threat-detection/prompt.txt` (workflow prompt), `agent_output.json` (safe output items), and `aw.patch` (git patch file).
**Available Artifacts:** Custom steps have access to `/tmp/gh-aw/threat-detection/prompt.txt` (workflow prompt), `agent_output.json` (safe output items), and `aw.patch` (git patch file). gh-aw also stages `/tmp/gh-aw/threat-detection/aw-prompts/prompt-template.txt`, `/tmp/gh-aw/threat-detection/aw-prompts/prompt-import-tree.json`, `/tmp/gh-aw/threat-detection/aw_info.json`, and any restored `/tmp/gh-aw/threat-detection/comment-memory/*.md` files so detectors can analyze prompt structure, activation context, and persisted comment memory.

**Execution Order:** Download artifacts → Execute pre-steps (`steps:`) → Run AI analysis (if enabled) → Execute post-steps (`post-steps:`) → Upload detection log.
**Execution Order:** Download artifacts → Stage detection inputs → Execute pre-steps (`steps:`) → Run AI analysis (if enabled) → Execute post-steps (`post-steps:`) → Upload detection log.

## Example: LlamaGuard Integration

Expand Down
Loading