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
The output appears in the **Summary** tab of the GitHub Actions workflow run.
100
100
101
+
## System-Injected Runtime Variables
102
+
103
+
GitHub Agentic Workflows automatically injects the following environment variables into every agentic engine execution step (both the main agent run and the threat detection run). These variables are read-only from the agent's perspective and are useful for writing workflows or agents that need to detect their execution context.
104
+
105
+
| Variable | Value | Description |
106
+
|----------|-------|-------------|
107
+
|`GITHUB_AW`|`"true"`| Present in every gh-aw engine execution step. Agents can check for this variable to confirm they are running inside a GitHub Agentic Workflow. |
108
+
|`GH_AW_PHASE`|`"agent"` or `"detection"`| Identifies which execution phase is active. `"agent"` for the main run; `"detection"` for the threat-detection safety check run that precedes the main run. |
109
+
|`GH_AW_VERSION`| e.g. `"0.40.1"`| The gh-aw compiler version that generated the workflow. Useful for conditional logic that depends on a minimum feature version. |
110
+
111
+
These variables appear alongside other `GH_AW_*` context variables in the compiled workflow:
112
+
113
+
```yaml
114
+
env:
115
+
GITHUB_AW: "true"
116
+
GH_AW_PHASE: agent # or "detection"
117
+
GH_AW_VERSION: "0.40.1"
118
+
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
119
+
```
120
+
121
+
> [!NOTE]
122
+
> These variables are injected by the compiler and cannot be overridden by user-defined `env:` blocks in the workflow frontmatter.
123
+
101
124
## Precedence Rules
102
125
103
126
Environment variables follow a **most-specific-wins** model, consistent with GitHub Actions. Variables at more specific scopes completely override variables with the same name at less specific scopes.
0 commit comments