scp-guardrails
Build AWS service control policies from a short spec and lint them for lockouts and statements that deny nothing.
What it is
scp-guardrails builds AWS Organizations service control policies from a short spec (region allowlist, protected roles, deny leaving the org, deny disabling CloudTrail and GuardDuty, deny root, require IMDSv2, deny public S3 ACLs, spend denies) under the SCP size limit, lints existing SCPs for the mistakes that lock you out or do nothing, and runs as a GitHub Action.
For cloud and platform engineers who run multi-account AWS organizations, and for whoever reviews SCP changes. Quick start (Python 3.11 or newer; the second line fetches the example spec):
pipx install git+https://github.com/basitalisandhu/scp-guardrails
curl -fsSLO https://raw.githubusercontent.com/basitalisandhu/scp-guardrails/main/examples/spec.yaml
scp-guardrails build --spec spec.yaml --out scps && scp-guardrails lint scps/
Output of those commands, as run on 2026-10-20:
scp-01.json: 4138/10240 chars, guardrails: allowed_regions, deny_disable_security_services, deny_iam_users_outside, deny_leave_organization, deny_public_s3_acls, deny_root_user, require_imdsv2
statements: DenyLeaveOrganization, DenyRootUser, ProtectCloudTrail, ProtectGuardDuty, ProtectSecurityHub, ProtectConfig, DenyOutsideAllowedRegions, DenyIamUsersOutsideIdentityAccount, RequireImdsv2OnLaunch, DenyImdsOptionChanges, DenyImdsv1RoleCredentials, DenyPublicS3CannedAcls, ProtectAccountPublicAccessBlock
wrote 1 document(s), manifest.json and SUMMARY.md to scps
Review every document and test it on a non-production OU before attaching it.
skipped scps/manifest.json: not an SCP document (no Statement)
scps/scp-01.json: 4138/10240 chars, 0 finding(s)
1 file(s), 0 finding(s): 0 high, 0 medium, 0 low.
Install
pip install scp-guardrails # once published to PyPI
pipx install git+https://github.com/basitalisandhu/scp-guardrails # the scp-guardrails command, isolated
uvx --from git+https://github.com/basitalisandhu/scp-guardrails scp-guardrails --help # run without installing
From the README; see the full README for every option.
Links
Releases
More in Security tooling
- agent-off-switch: Find every AI agent identity in Microsoft 365, AWS and GitHub, see what it can reach, and switch it off. Offline on saved exports.
- skill-scan-gate: CI gate for Claude Code skills and plugins, with SARIF output. GitHub Action and CLI.
- agent-threat-model: Threat modeling for AI agents: describe the system in YAML, get a STRIDE and OWASP Agentic threat model.
- agent-config-audit: Audit AI agent configuration files for security risks.
- agentic-semgrep-rules: Semgrep rules for AI agent code in Python, TypeScript and JavaScript.
- security-actions: GitHub Actions for AI agent and supply chain security checks.
- cc-hooks: Typed Python SDK and offline test runner for Claude Code hooks.
- cc-plugin-lock: Lock file for Claude Code plugins: pins plugins and skills to content hashes and verifies them before load.
- claude-perm-sim: Claude Code permission rule simulator: shows which rule decides a tool call and where a rule set is permissive.
- llms-txt-gen: Generate llms.txt for any docs site or repository.
- spotlighting: Spotlighting for prompt injection defence in Python: mark untrusted text before it reaches a model.
- llm-agent-control-plane: Deterministic policy enforcement for LLM agents.
Topics: aws, aws-organizations, aws-security, cli, cloud-security, devsecops, github-actions, guardrails, hacktoberfest, iam, landing-zone, linter, policy-as-code, python, sarif, scp, security-tools, service-control-policies