원클릭으로
agentic-workflow-security
// 5-layer defense-in-depth security for GitHub Agentic Workflows - safe outputs, threat detection, AWF firewall, and zero-trust patterns
// 5-layer defense-in-depth security for GitHub Agentic Workflows - safe outputs, threat detection, AWF firewall, and zero-trust patterns
GitHub Agentic Workflows (gh-aw) - markdown-based AI automation with 5-layer security, safe outputs, and Continuous AI patterns
gh-aw CLI usage, compilation, testing, debugging, add-wizard, and CI/CD practices for GitHub Agentic Workflows
Multi-agent coordination, orchestrator-worker patterns, /plan decomposition, and project coordination for GitHub Agentic Workflows
Continuous AI patterns from Agent Factory - issue triage, documentation sync, code quality, security scanning, and project coordination
GDPR compliance including privacy by design, data protection requirements, consent management, right to be forgotten, and data breach response
Approved cryptographic algorithms, TLS enforcement, key management, and certificate handling per Hack23 Cryptographic Controls Policy
| name | agentic-workflow-security |
| description | 5-layer defense-in-depth security for GitHub Agentic Workflows - safe outputs, threat detection, AWF firewall, and zero-trust patterns |
| license | Apache-2.0 |
Comprehensive security guidance for GitHub Agentic Workflows implementing the official 5-layer defense-in-depth architecture: read-only tokens, zero secrets in agent, containerized execution with Agent Workflow Firewall (AWF), safe outputs with guardrails, and agentic threat detection.
Apply this skill when:
MUST implement all five official security layers:
MUST NOT:
MUST:
issues: read, contents: read) not read-allmax: limitstimeout-minutes: on all workflowsMUST NOT:
permissions: write-all without security reviewMUST:
safe-outputs: with specific constraints:
max: — Hard limit per operation per runtitle-prefix: — Required prefix for created issues/PRslabels: — Required/allowed labelsallowed: — Allowlist of label values for add-labelsclose-older-issues: — Auto-close previous reportsbranch: — Target branch for asset uploadsmax-size: — File size limits for uploadsallowed-exts: — Permitted file extensionsthreat-detection: with action: block for all production workflowsMUST NOT:
max: limits without justificationMUST:
safe-inputs: sectionMUST NOT:
MUST:
threat-detection: settings appropriatelyMUST NOT:
MUST:
network: {} for zero external access (most secure)network: defaults for GitHub-only access (github.com, api.github.com)MUST NOT:
MUST:
ANTHROPIC_API_KEY)MUST NOT:
MUST:
MUST NOT:
MUST:
MUST NOT:
MUST:
MUST NOT:
---
on: issues
permissions: read-all # Read-only default
tools:
github:
network: {} # No external network access
safe-outputs:
create-comment:
max: 1 # Single comment per execution
---
# Secure Issue Triage
Analyze issue and post triage comment.
---
on: pull_request
permissions: read-all
tools:
github:
safe-outputs:
create-comment:
max: 3
threat-detection:
enabled: true
scan-for:
- prompt-injection
- secret-leak
- malicious-code
action: block # Block on threats
---
# Secure Code Review
Review pull request for security issues.
Threat detection automatically scans outputs before posting.
---
on: issues
permissions: read-all
tools:
github:
safe-inputs:
calculate_risk_score:
type: function
description: Calculate security risk score
code: |
function calculate_risk_score(title, labels) {
// Input validation
if (!title || typeof title !== 'string') return 0;
if (!Array.isArray(labels)) return 0;
let score = 0;
// Sanitize inputs
const safetitle = String(title).toLowerCase();
if (labels.includes('security')) score += 10;
if (labels.includes('vulnerability')) score += 10;
if (safetitle.includes('rce')) score += 8;
if (safetitle.includes('sql injection')) score += 8;
return Math.min(score, 10);
}
safe-outputs:
create-comment:
max: 1
---
# Security Risk Assessment
Use calculate_risk_score to assess security issues.
Post risk score and recommended response timeline.
---
on: workflow_dispatch
permissions: read-all
tools:
github:
network:
defaults:
- github.com
- api.github.com
- raw.githubusercontent.com
# Explicitly no other domains allowed
safe-outputs:
create-issue:
max: 1
---
# Security Audit (Network Restricted)
Perform security audit using only GitHub APIs.
No external network access to prevent data exfiltration.
---
on: pull_request
permissions: read-all
tools:
github:
safe-outputs:
create-code-scanning-alert:
max: 1
---
# Security Code Scanning
Analyze code changes for security vulnerabilities:
1. Check for hard-coded secrets
2. Identify injection vulnerabilities
3. Detect unsafe deserialization
4. Find insecure cryptography usage
Generate SARIF report and upload to GitHub Code Scanning.
---
on: workflow_dispatch
permissions: read-all
tools:
github:
playwright:
safe-outputs:
upload-asset:
branch: "assets/security-reports"
max-size: 5120 # 5MB limit
allowed-exts: [.png, .pdf, .json]
---
# Security Screenshot Generation
Generate security dashboard screenshots.
Upload only allowed file types to isolated branch.
---
on: issues
permissions: read-all
tools:
github:
network:
defaults: # Layer 1: Network restriction
safe-inputs: # Layer 2: Validated custom tools
sanitize_input:
type: function
code: |
function sanitize_input(text) {
return String(text)
.replace(/[<>]/g, '')
.substring(0, 1000);
}
safe-outputs: # Layer 3: Safe write operations
create-comment:
max: 1
threat-detection: # Layer 4: Output validation
enabled: true
action: block
---
# Defense-in-Depth Security Analysis
Multi-layer security for issue analysis.
---
on: pull_request
permissions: read-all
tools:
github:
safe-outputs:
update-project:
# Use fine-grained PAT with minimal scopes:
# - Read access to metadata
# - Write access to projects
github-token: ${{ secrets.GH_AW_PROJECT_TOKEN }}
max: 1
---
# Secure Project Board Update
Update project board with PR status.
Uses minimal-scope token for Projects API only.
Before deploying an agentic workflow:
---
permissions: write-all # WRONG: Too broad
---
✅ Correct Approach:
---
permissions: read-all
safe-outputs:
create-comment:
max: 1
---
---
engine: claude
env:
ANTHROPIC_API_KEY: sk-ant-abc123 # WRONG: Secret in code
---
✅ Correct Approach:
---
engine: claude
# Secret configured in GitHub Secrets
---
---
tools:
web-fetch: # WRONG: No network restrictions
---
✅ Correct Approach:
---
tools:
web-fetch:
network:
defaults:
- trusted-domain.com
---
---
safe-outputs:
create-pull-request:
max: 1
# WRONG: No threat detection
---
✅ Correct Approach:
---
safe-outputs:
create-pull-request:
max: 1
threat-detection:
enabled: true
action: block
---
# WRONG: Using raw issue title in command
Execute: analyze-tool --input="${issue.title}"
✅ Correct Approach:
# Sanitize user input before use
safe-inputs:
sanitize:
code: |
function sanitize(input) {
return input.replace(/[^a-zA-Z0-9 ]/g, '');
}
This skill implements requirements from:
Security violations in agentic workflows: