Skip to content

Commit c7d8078

Browse files
docs: document secrets-in-custom-steps compiler check (PR #24450)
Add Secrets in Custom Steps Validation subsection to the Compiler Validation section of scratchpad/dev.md. Documents the new validateStepsSecrets() check introduced in pkg/workflow/strict_mode_steps_validation.go: behavior in strict vs. non-strict mode, GITHUB_TOKEN exemption, and migration guidance. Bumps dev.md to v5.2. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e255fc7 commit c7d8078

1 file changed

Lines changed: 43 additions & 2 deletions

File tree

scratchpad/dev.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Developer Instructions
22

3-
**Version**: 5.1
4-
**Last Updated**: 2026-04-03
3+
**Version**: 5.2
4+
**Last Updated**: 2026-04-04
55
**Purpose**: Consolidated development guidelines for GitHub Agentic Workflows
66

77
This document consolidates specifications from the scratchpad directory into unified developer instructions. It provides architecture patterns, security guidelines, code organization rules, and testing practices.
@@ -442,6 +442,46 @@ func ValidatePermissions(perms map[string]string) error {
442442
}
443443
```
444444

445+
### Secrets in Custom Steps Validation
446+
447+
The compiler validates that `secrets.*` expressions are not used in `steps` and `post-steps` frontmatter sections (introduced in PR #24450).
448+
449+
**Purpose**: Minimize secrets exposed to the agent job. The only secrets that should appear in the agent job are those required to configure the agentic engine itself. Steps or post-steps that need secrets should be moved to a separate GitHub Actions job outside the agent job.
450+
451+
**Behavior**:
452+
- **Strict mode** (`--strict`): compilation fails with an error listing the found expressions
453+
- **Non-strict mode**: a warning is emitted and the warning counter is incremented
454+
- `${{ secrets.GITHUB_TOKEN }}` is exempt — it is the built-in runner token, automatically available in every runner environment, and not a user-defined secret
455+
456+
**Implementation**: `pkg/workflow/strict_mode_steps_validation.go``Compiler.validateStepsSecrets()`; called from `pkg/workflow/compiler_orchestrator_engine.go`.
457+
458+
**Error message** (strict mode):
459+
```
460+
strict mode: secrets expressions detected in 'steps' section may be leaked to the agent job.
461+
Found: ${{ secrets.MY_SECRET }}.
462+
Operations requiring secrets must be moved to a separate job outside the agent job
463+
```
464+
465+
**Migration**:
466+
```yaml
467+
# ❌ Avoid: secret in custom step leaks into agent job
468+
steps:
469+
- name: Deploy
470+
env:
471+
API_KEY: ${{ secrets.DEPLOY_KEY }}
472+
run: ./deploy.sh
473+
474+
# ✅ Correct: secrets in a separate job outside the agent job
475+
jobs:
476+
deploy:
477+
needs: agent
478+
steps:
479+
- name: Deploy
480+
env:
481+
API_KEY: ${{ secrets.DEPLOY_KEY }}
482+
run: ./deploy.sh
483+
```
484+
445485
### Runtime Validation
446486
447487
**Responsibilities**:
@@ -2675,6 +2715,7 @@ These files are loaded automatically by compatible AI tools (e.g., GitHub Copilo
26752715
---
26762716

26772717
**Document History**:
2718+
- v5.2 (2026-04-04): Added Secrets in Custom Steps Validation subsection to Compiler Validation (from PR #24450: `pkg/workflow/strict_mode_steps_validation.go`). Documents `validateStepsSecrets()` behavior in strict vs. non-strict mode, `secrets.GITHUB_TOKEN` exemption, and migration guidance. Coverage: 72 spec files (no new spec files; new Go implementation only).
26782719
- v5.1 (2026-04-03): Maintenance tone scan — 0 tone issues found across 3 previously uncovered spec files. Added 3 new Related Documentation links: `agent-sessions.md` (terminology migration plan), `safe-output-handlers-refactoring.md` (handler factory pattern status), `serena-tools-analysis.md` (Serena tool usage statistics). Coverage: 72 spec files (3 new).
26792720
- v5.0 (2026-04-02): Maintenance tone scan — fixed 3 tone issues across 2 previously uncovered spec files: `capitalization.md` (2 fixes: "maintains professional consistency"→removed, "simplifies both user comprehension"→"reduces ambiguity for contributors"), `mdflow.md` ("significantly exceeds"→"supports capabilities not currently available in"). Added 7 new Related Documentation links for 7 previously uncovered spec files (capitalization.md, labels.md, gastown.md, mdflow.md, mdflow-comparison.md, oh-my-code.md). Coverage: 69 spec files (7 new).
26802721
- v4.9 (2026-04-01): Maintenance tone scan — fixed 5 tone issues across 4 spec files: `engine-architecture-review.md` (removed "well-implemented", replaced 5-star ratings with factual assessment), `engine-review-summary.md` (removed "production-ready", replaced rating section with factual conclusion), `mcp_logs_guardrails.md` (2 fixes: "helpful guidance"→"jq filter suggestions and schema", "Keeps output manageable"→"Limits response size"), `visual-regression-testing.md` (removed "negatively impact the user experience"). Added 21 new Related Documentation links for previously uncovered spec files. Coverage: 62 spec files.

0 commit comments

Comments
 (0)