Skip to content

Commit 64b8d35

Browse files
docs(site): document all blocked args/env keys in engine reference (#708)
1 parent e20933a commit 64b8d35

1 file changed

Lines changed: 65 additions & 3 deletions

File tree

site/src/content/docs/reference/engine.mdx

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ engine:
2323
| Field | Type | Default | Description |
2424
|-------|------|---------|-------------|
2525
| `id` | string | `copilot` | Engine identifier. Currently only `copilot` (GitHub Copilot CLI) is supported. |
26-
| `model` | string | `claude-opus-4.7` | AI model to use. Options include `claude-sonnet-4.5`, `gpt-5.2-codex`, `gemini-3-pro-preview`, etc. |
26+
| `model` | string | `claude-opus-4.7` | AI model to pass to the Copilot CLI `--model` flag. Any model ID supported by GitHub Copilot is accepted (e.g., `claude-sonnet-4.7`, `claude-opus-4.7`). The compiler does not validate the value — an unrecognised ID produces a runtime error from the CLI. |
2727
| `timeout-minutes` | integer | *(none)* | Maximum time in minutes the agent job is allowed to run. Sets `timeoutInMinutes` on the `Agent` job in the generated pipeline. |
2828
| `version` | string | *(none)* | Engine CLI version to install (e.g., `"1.0.43"`, `"latest"`). Overrides the pinned `COPILOT_CLI_VERSION`. Set to `"latest"` to use the newest available version. |
2929
| `agent` | string | *(none)* | Custom agent file identifier (Copilot only). Adds `--agent <name>` to the CLI invocation, selecting a custom agent from `.github/agents/`. |
3030
| `api-target` | string | *(none)* | Custom API endpoint hostname for GHES/GHEC (e.g., `"api.acme.ghe.com"`). Adds `--api-target <hostname>` to the CLI invocation and adds the hostname to the AWF network allowlist. |
31-
| `args` | list | `[]` | Custom CLI arguments appended after compiler-generated args. Subject to shell-safety validation and blocked from overriding compiler-controlled flags (`--prompt`, `--allow-tool`, `--disable-builtin-mcps`, etc.). |
32-
| `env` | map | *(none)* | Engine-specific environment variables merged into the sandbox step's `env:` block. Keys must be valid env var names; values must not contain ADO expressions (`$(`, `${{`) or pipeline command injection (`##vso[`). Compiler-controlled keys (`GITHUB_TOKEN`, `PATH`, `BASH_ENV`, etc.) are blocked. |
31+
| `args` | list | `[]` | Custom CLI arguments appended after compiler-generated args. Subject to shell-safety validation and blocked from overriding compiler-controlled flags (see [`args` reference](#args) below). |
32+
| `env` | map | *(none)* | Engine-specific environment variables merged into the sandbox step's `env:` block. Keys must be valid env var names; values must not contain ADO expressions (`$(`, `${{`) or pipeline command injection (`##vso[`). Compiler-controlled keys are blocked (see [`env` reference](#env) below). |
3333
| `command` | string | *(none)* | Custom engine executable path (skips default NuGet installation). The path must be accessible inside the AWF container (e.g., `/tmp/...` or workspace-mounted paths). |
3434

3535

@@ -42,3 +42,65 @@ The `timeout-minutes` field sets a wall-clock limit (in minutes) for the entire
4242
- **SLA compliance** -- ensuring scheduled agents complete within a known window.
4343

4444
When omitted, Azure DevOps uses its default job timeout (60 minutes). When set, the compiler emits `timeoutInMinutes: <value>` on the agentic job.
45+
46+
### `args`
47+
48+
The `args` list appends raw CLI arguments to the Copilot invocation. This is an escape hatch for passing flags that `ado-aw` does not yet model in front matter — use it sparingly.
49+
50+
The compiler rejects any argument that starts with one of the following blocked prefixes, because those flags are owned and managed by the compiler:
51+
52+
| Blocked prefix | Reason |
53+
|----------------|--------|
54+
| `--prompt` | Compiler controls how the prompt is supplied |
55+
| `--additional-mcp-config` | Compiler owns MCP configuration |
56+
| `--allow-tool` | Compiler controls tool allow-listing |
57+
| `--allow-all-tools` | Compiler controls tool allow-listing |
58+
| `--allow-all-paths` | Compiler controls path permissions |
59+
| `--disable-builtin-mcps` | Compiler manages built-in MCP setup |
60+
| `--no-ask-user` | Compiler controls interactive-mode setting |
61+
| `--ask-user` | Compiler controls interactive-mode setting |
62+
63+
Each argument is also checked against a shell-safety character allowlist to prevent injection.
64+
65+
Example — enabling a hypothetical experimental flag:
66+
67+
```yaml
68+
engine:
69+
id: copilot
70+
args:
71+
- --experimental-feature
72+
- --log-level=debug
73+
```
74+
75+
### `env`
76+
77+
The `env` map injects additional environment variables into the sandbox step's `env:` block. This is useful for passing API tokens, configuration values, or feature flags that the agent script needs.
78+
79+
The compiler blocks keys that it controls:
80+
81+
| Blocked key | Reason |
82+
|-------------|--------|
83+
| `GITHUB_TOKEN` | Compiler-managed auth token |
84+
| `GITHUB_READ_ONLY` | Compiler-managed auth mode |
85+
| `COPILOT_OTEL_ENABLED` | Compiler-managed telemetry |
86+
| `COPILOT_OTEL_EXPORTER_TYPE` | Compiler-managed telemetry |
87+
| `COPILOT_OTEL_FILE_EXPORTER_PATH` | Compiler-managed telemetry |
88+
| `PATH` | System shell variable |
89+
| `HOME` | System shell variable |
90+
| `BASH_ENV` | System shell variable |
91+
| `ENV` | System shell variable |
92+
| `IFS` | System shell variable |
93+
| `LD_PRELOAD` | Dynamic linker — security-sensitive |
94+
| `LD_LIBRARY_PATH` | Dynamic linker — security-sensitive |
95+
96+
Values must not contain ADO macro expressions (`$(...)`) or pipeline command injection markers (`##vso[`).
97+
98+
Example — passing a custom API key:
99+
100+
```yaml
101+
engine:
102+
id: copilot
103+
env:
104+
MY_API_KEY: "$(MY_API_KEY)" # inject from pipeline variable
105+
STATIC_CONFIG: "production" # literal value
106+
```

0 commit comments

Comments
 (0)