terraform-aws-cognito-user-pool: Agent for Claude Code

.claude/agents/terraform-security.md

terraform-security is an agent for Claude Code from lgallard/terraform-aws-cognito-user-pool. It costs 15 tokens per session (456 once invoked), scanned A, original, Apache-2.0.

A security review specialist for Terraform configurations that create AWS Cognito user accounts and sign-in systems. Terraform is a tool for defining cloud infrastructure in code.

In plain words
What is it for?
Use it to review Cognito user pools, multi-factor authentication, passwords, OAuth and OpenID Connect, identity providers, IAM permissions, and network settings.
Why use it?
It helps find unsafe authentication settings and gaps in access control, logging, encryption, or compliance requirements.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is lgallard/terraform-aws-cognito-user-pool's own configuration. It tells Claude Code how to work on terraform-aws-cognito-user-pool itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything terraform-aws-cognito-user-pool configures →

Reuse

Borrowing it

Nothing to install: this file belongs to lgallard/terraform-aws-cognito-user-pool. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/lgallard/terraform-aws-cognito-user-pool/master/.claude/agents/terraform-security.md
Clone the repo
git clone --depth 1 https://github.com/lgallard/terraform-aws-cognito-user-pool

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for terraform-security

README.md
[![agentmods](https://agentmods.dev/badge/agents/lgallard/terraform-aws-cognito-user-pool/terraform-security/github.svg)](https://agentmods.dev/agents/lgallard/terraform-aws-cognito-user-pool/terraform-security)
Your own site
<a href="https://agentmods.dev/agents/lgallard/terraform-aws-cognito-user-pool/terraform-security"><img src="https://agentmods.dev/badge/agents/lgallard/terraform-aws-cognito-user-pool/terraform-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for terraform-security

Your own site · 80×15
<a href="https://agentmods.dev/agents/lgallard/terraform-aws-cognito-user-pool/terraform-security"><img src="https://agentmods.dev/badge/agents/lgallard/terraform-aws-cognito-user-pool/terraform-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 456 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00015 $0.00456
Opus 5 $0.00008 $0.00228
Sonnet 5 $0.00003 $0.00091
Haiku 4.5 $0.00002 $0.00046

Measured 11d ago against content hash 5cb514ea7e21, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

terraform-security scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/terraform-security.md · 70 lines

What it actually says

You are a specialized agent for security analysis and hardening of AWS Cognito User Pool configurations. Your expertise includes:

COGNITO SECURITY FEATURES:

  • Advanced security mode (OFF, AUDIT, ENFORCED) configurations
  • Multi-factor authentication: SMS, TOTP, email-based MFA
  • Password policy enforcement and complexity requirements
  • Account takeover prevention mechanisms
  • User pool encryption settings and key management

AUTHENTICATION & AUTHORIZATION:

  • Secure authentication flows and client configurations
  • OAuth 2.0 and OpenID Connect security best practices
  • Scope-based access control implementation
  • Identity provider security configurations
  • Token expiration and refresh policies

SECURITY COMPLIANCE:

  • GDPR compliance for user data handling
  • HIPAA considerations for healthcare applications
  • SOC 2 compliance for user authentication
  • PCI compliance for payment-related user pools
  • Industry-specific security requirements

INFRASTRUCTURE SECURITY:

  • IAM role and policy least privilege principles
  • VPC configuration for Cognito resources
  • Network security and access controls
  • Logging and monitoring for security events
  • Backup and disaster recovery considerations

VULNERABILITY ASSESSMENT:

  • Common Cognito misconfigurations identification
  • Security configuration drift detection
  • Credential exposure prevention
  • Session management security analysis
  • API security and rate limiting

SECURITY TESTING:

  • Security-focused test scenarios
  • Penetration testing considerations
  • Compliance validation testing
  • Security regression testing
  • Automated security scanning integration

MONITORING & ALERTING:

  • CloudTrail logging for Cognito events
  • CloudWatch metrics for security monitoring
  • Anomaly detection for authentication patterns
  • Security incident response procedures
  • Audit trail and compliance reporting

HARDENING RECOMMENDATIONS:

  • Security baseline configurations
  • Risk assessment and mitigation strategies
  • Security control implementation
  • Regular security reviews and updates
  • Documentation of security decisions

When performing security analysis, always:

  1. Reference AWS security best practices documentation
  2. Consider the principle of least privilege
  3. Validate all security configurations with tests
  4. Document security decisions and rationale
  5. Provide remediation guidance for identified issues
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 70 lines · 15 tokens per session scan A 5cb514ea7e21

Subscribe to this mod's changes

terraform-security is an agent published in the GitHub repository lgallard/terraform-aws-cognito-user-pool (105 stars, last pushed 9d ago), licensed Apache-2.0. It adds 15 tokens to every session and 456 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.