feat: add fail-closed-security-hooks plugin (runtime guardrails for regulated data) - #9
Open
timwukp wants to merge 1 commit into
Open
Conversation
Adds a second plugin to the marketplace: runtime guardrails on what the
agent does, for startups touching regulated data (fintech, health).
Five hooks via a fail-closed telemetry shim:
- pii-guard PII/secrets + national IDs (US/UK/JP/KR/SG/EU/AU)
blocked before reaching the model
- git-guard remote allowlist, force-push/protected-branch,
destructive-op blocking
- audit-logger tamper-evident HMAC-chained JSONL audit log,
optional CloudWatch/SIEM dual-write
- token-budget-guard per-session runaway-loop circuit breaker
- hook-wrapper turns silent hook crashes/timeouts into exit-2
denials (fail-closed)
New plugins/fail-closed-security-hooks/ (plugin.json, hooks/, scripts/,
README, LICENSE); registered in marketplace.json (bumped 0.3.0 -> 0.4.0)
and listed in README. aws-dev-toolkit is untouched.
Implements aws-samples#7. Upstream source + 76-assertion suite:
https://github.com/timwukp/claude-code-on-aws-bedrock-best-practices
(Apache-2.0; this contributed copy MIT-0 to match the repo).
Author
|
Friendly ping — just noting that the same fail-closed hooks pattern landed in aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock#550 last week (merged by wirjo, LGTM). Happy to rebase, split, or adjust the PR format if that would help move it forward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #7.
What this adds
A second plugin to the marketplace:
fail-closed-security-hooks— runtime guardrails on what the agent does, the layer a startup hits the moment it touches regulated data (fintech, health).aws-dev-toolkitis the build-side companion; this is the guardrail-side one.Five hooks wired through a fail-closed telemetry shim:
exit 2denials — fails safe, not openLayout (per the README's "Adding More Plugins" recipe)
Registered in
.claude-plugin/marketplace.json(metadata version0.3.0 → 0.4.0) and listed under Plugins in the README.aws-dev-toolkitis untouched.Testing
Smoke-tested locally: pii-guard blocks an AWS key (exit 2) and passes benign prompts (exit 0); hook-wrapper turns a crashing hook into exit 2; the audit chain verifies intact (exit 0) and catches a deleted line as tampered (exit 1). Upstream carries a 76-assertion suite and passes
claude plugin validate --strict: https://github.com/timwukp/claude-code-on-aws-bedrock-best-practicesLicensing
Source is Apache-2.0; this contributed copy is MIT-0 to match the repository. "Allow edits from maintainers" is enabled — happy to adjust naming/category or scope down if you'd prefer.