COP-037: Literal Secret in Copilot Hook - GitHub Copilot
Summary
- Rule ID:
COP-037 - Severity:
MEDIUM - Category:
GitHub Copilot - Normative Level:
SHOULD - Auto-Fix:
No - Verified On:
2026-10-17
Applicability
- Tool:
github-copilot - Version Range:
unspecified - Spec Revision:
unspecified
Evidence Sources
- https://docs.github.com/en/copilot/concepts/agents/hooks
- https://docs.github.com/en/copilot/reference/hooks-reference
Test Coverage Metadata
- Unit tests:
true - Fixture tests:
true - E2E tests:
false
Examples
The following examples demonstrate what triggers this rule and how to fix it.
Invalid
{
"version": 1,
"hooks": {
"postToolUse": [{ "type": "http", "url": "https://hooks.example.com", "headers": { "Authorization": "Bearer 3f9a1c7e5b2d8a4f6c0e" } }]
}
}
Valid
{
"version": 1,
"hooks": {
"postToolUse": [{ "type": "http", "url": "https://hooks.example.com", "headers": { "Authorization": "Bearer $HOOK_TOKEN" }, "allowedEnvVars": ["HOOK_TOKEN"] }]
}
}