Using the Terracotta AI Bot in Pull Requests

🤖 Using the Terracotta AI Bot in Your PR

The Terracotta AI bot is always available in your pull request to provide real-time, contextual support for infrastructure-related questions.

🔍 What It Can Do

The bot can answer questions related to:

  • Terraform syntax, modules, resources, and usage

  • CDK for Terraform (CDK-TF) in TypeScript

  • Cloud provider services like AWS, GCP, Azure

  • Contextual understanding of your PR, including:

    • The full diff
    • The surrounding IaC code
    • The overall repository structure

This means you can ask about:

  • Why a particular line in the PR might cause a misconfiguration
  • What a specific module does
  • How does a change impact the infrastructure as a whole
  • Security or cost implications of changes

💬 How to Ask Questions

You can engage with the bot directly inside a PR comment:

  • Mention the bot directly:
@try-terracotta What does this IAM role allow?
  • Use thetc: shorthand:
tc: What resources will be created from this diff?

The bot will respond contextually within the same thread, utilizing knowledge of your repository and IaC tooling.

The bot understands context across the repo, so feel free to ask high-level architecture or drift-related questions.


🛠️ Command Reference

All commands are typed as PR comments. They trigger specific analysis tasks and post results in the same thread.

Terraform Commands

CommandDescription
tc:reviewFull AI code review with structured findings, severity ratings, and fix suggestions
tc:planRun terraform plan and analyze security, cost, and blast radius
tc:summaryHigh-level summary of infrastructure changes in the PR
tc:costMonthly and annual cost impact estimation for proposed changes
tc:driftCompare Terraform state against live cloud resources for drift
tc:guardCheck PR against your organization's custom guardrail policies
tc:conflictDetect resource conflicts across active PRs modifying Terraform in parallel
tc:blast-radiusMap downstream impact — direct dependencies, transitive effects, cross-stack risks
tc:depsAnalyze module-level topology, critical paths, and single points of failure
tc:architectureGenerate a Mermaid infrastructure diagram of the resource dependency graph

Security Commands

CommandDescription
tc:iamDeep-dive IAM analysis — privilege escalation, wildcard actions, overly broad trust policies
tc:tagValidate resource tagging against organizational standards

Kubernetes Commands

CommandDescription
tc:k8s-reviewDetailed code review of Kubernetes manifests with structured findings
tc:k8s-securityAudit RBAC, pod security standards, and privilege escalation risks
tc:k8s-validateValidate YAML syntax, schema compliance, and manifest correctness
tc:k8s-resourcesAnalyze resource requests, limits, and CPU/memory allocation
tc:k8s-summarySummarize all Kubernetes manifest changes in the PR
tc:k8s-guardValidate K8s manifests against your organization's guardrail policies
tc:k8s-conflictDetect conflicts in K8s manifests across multiple open PRs

🔍 Full API Reference

For programmatic access to these same commands, see the Terracotta API documentation.


📋 TL;DR

  • Mention @try-terracotta or use tc: prefix to interact with the bot in any PR
  • 10 Terraform commands, 2 security commands, and 7 Kubernetes commands available
  • The bot has full context of your repo, diff, and infrastructure state
  • All commands post structured findings with severity ratings and fix suggestions