Agentic workflows automatically handle several types of secrets and support custom secret references.
These secrets are automatically available in all workflows:
- Purpose: GitHub API access for repository operations
- Scope: Permissions defined in workflow
permissions:section - Usage: Automatically used by GitHub tools and MCP servers
permissions:
issues: write # GITHUB_TOKEN gets issue write access
contents: read # GITHUB_TOKEN gets content read accessYou need to define custom secrets in your repository or organization settings to enable usage of your chosen agentic processor and external services.
- Purpose: Claude engine access
- Required for:
engine: claudeworkflows (default) - Setup: Add to repository or organization secrets
- Usage: Automatically used by Claude engine
- Purpose: Codex and OpenAI-based engines
- Required for:
engine: codexworkflows (experimental) - Setup: Add to repository or organization secrets
- Usage: Automatically used by Codex engine
Custom secrets for MCP servers are referenced using ${secrets.SECRET_NAME} syntax:
tools:
trello:
mcp:
type: stdio
command: "python"
args: ["-m", "trello_mcp"]
env:
TRELLO_TOKEN: "${{ secrets.TRELLO_TOKEN }}"
TRELLO_KEY: "${{ secrets.TRELLO_KEY }}"
allowed: ["list_boards", "create_card"]You can define custom environment variables in the workflow frontmatter:
env:
NODE_ENV: "production"
DEBUG: "false"
CUSTOM_CONFIG: "${{ secrets.MY_CONFIG }}"# Set secrets for a specific repository
gh secret set ANTHROPIC_API_KEY -a actions --body <your-api-key>
gh secret set TRELLO_TOKEN -a actions --body <your-trello-token># Set secrets for all repositories in an organization
gh secret set ANTHROPIC_API_KEY -a actions --org <your-org> --body <your-api-key>- Secrets are only accessible to workflows with appropriate permissions
- Secrets are automatically masked in workflow logs
- Use minimal scope secrets when possible
- Use UPPER_CASE names for secrets
- Use descriptive names that indicate the service:
TRELLO_TOKEN,SLACK_WEBHOOK - Avoid exposing secret values in frontmatter or markdown content
# ✅ Good: Secret reference
env:
API_KEY: "${{ secrets.MY_API_KEY }}"
# ❌ Bad: Hardcoded value
env:
API_KEY: "sk-1234567890abcdef"- Commands - CLI commands for workflow management
- Workflow Structure - Directory layout and organization
- Frontmatter Options - All configuration options
- Tools Configuration - GitHub and other tools setup
- MCPs - Model Context Protocol setup and configuration
- Include Directives - Modularizing workflows with includes