Agent skill

Tirith Policies

by StackGuardian in StackGuardian/tirith

Write, validate, run and debug Tirith IaC governance policies, install Tirith, and add it to a CI pipeline (GitHub Actions, GitLab CI, Bitbucket Pipelines, Jenkins, Azure DevOps, CircleCI or any…

Apache-2.0Auto-check passedDevOps & Cloud

Install Tirith Policies

skills CLI
$ npx skills add StackGuardian/tirith --skill tirith-policies -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install StackGuardian/tirith tirith-policies --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/StackGuardian/tirith.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/tirith-policies .claude/skills/tirith-policies && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tirith-policies
GitHub stars
170
Token cost
~1.8k tokens
SKILL.md length
821 words
Files
15
Skills in repo
3
Repo updated
First seen
Licence
Apache-2.0

At a glance

Write, validate, run and debug Tirith IaC governance policies, install Tirith, and add it to a CI pipeline (GitHub Actions, GitLab CI, Bitbucket Pipelines, Jenkins, Azure DevOps, CircleCI or any…

  • Works in 4 steps: Document. Terraform or OpenTofu plan,… → Operation. Each provider exposes a… → Key naming the value. It differs per… → …
  • Editing files under .tirith/policies
  • SKILL.md covers Install, The one rule, Exit codes and Write a policy, plus 4 more sections
  • Calls pip

What it does

Tirith Policies is an agent skill from StackGuardian/tirith. Write, validate, run and debug Tirith IaC governance policies, install Tirith, and add it to a CI pipeline (GitHub Actions, GitLab CI, Bitbucket Pipelines, Jenkins, Azure DevOps, CircleCI or any container runner). Use when writing or editing files under .tirith/policies, when a Tirith check fails in CI, when asked to add a guardrail to a Terraform or OpenTofu pipeline, or when reading a Tirith result document or exit code.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 17 other files (for example `examples/required-tags/README.md`, `examples/required-tags/policy.json` and `examples/required-tags/should-fail.json`).

It sits in DevOps & Cloud, covering Infrastructure as code and CI/CD. It works with Terraform, Azure DevOps, Bitbucket and GitHub Actions. The repository describes itself as: Plug IaC governance into any IaC pipeline. Evaluate plans with Tirith, protect sensitive values, enforce centralised policies, and surface actionable results before… The licence is Apache-2.0.

When your agent uses it

  • Editing files under .tirith/policies
  • A Tirith check fails in CI
  • Asked to add a guardrail to a Terraform
  • OpenTofu pipeline

Example prompts

  • “/tirith-policies”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Document. Terraform or OpenTofu plan, Kubernetes manifest, Infracost breakdown, or arbitrary
  2. Operation. Each provider exposes a closed set: reference/schema.md.
  3. Key naming the value. It differs per provider, and a wrong key is ignored, not rejected,
  4. Condition. Thirteen, listed in reference/schema.md. There is no Exists.

What it can do on your machine

Read from SKILL.md and the folder at commit 85064b9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tirith Policies loads about 1.8k tokens when it runs. Until then it costs about 111 tokens; SKILL.md has 821 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~111
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from StackGuardian/tirith at commit 85064b9, republished under its Apache-2.0 licence (© StackGuardian). 821 words, ~1,798 tokens.

Download SKILL.mdSave it as .claude/skills/tirith-policies/SKILL.md (or your agent's skills folder). This skill also uses 14 other files; get the full folder from GitHub.
name
tirith-policies
description
Write, validate, run and debug Tirith IaC governance policies, install Tirith, and add it to a CI pipeline (GitHub Actions, GitLab CI, Bitbucket Pipelines, Jenkins, Azure DevOps, CircleCI or any container runner). Use when writing or editing files under .tirith/policies, when a Tirith check fails in CI, when asked to add a guardrail to a Terraform or OpenTofu pipeline, or when reading a Tirith result document or exit code.

Tirith

Tirith evaluates the plan a pipeline already produces against declarative JSON policies and exits non-zero so a violating change never reaches apply. A policy is JSON data, not a program: it names a provider, the value to inspect, and the condition that value must satisfy.

Install

Not from PyPI. pip install tirith installs an unrelated project; py-tirith is the setup.py name and is not published. Install from git, pinned to a tag:

bash
pip install "git+https://github.com/StackGuardian/tirith.git@1.2.1"
tirith --version   # 1.2.1

The one rule

Never hand back a policy you have not run against a document that should fail it.

A policy that matches nothing looks identical to one that works. Run it against input you expect to be refused. Exit 0 means it matched nothing and gates nothing.

bash
tirith -policy-path .tirith/policies -input-path should-fail.json --fail-on-error; echo $?   # want 3

Exit codes

ExitMeaningWhat CI should do
0Every check passedContinue to apply
3A policy failedFail the job: the change was refused
1No verdict could be reachedFail the job, but report a tool or input problem
  • Never collapse 3 into 1. A job that cannot tell them apart reports an outage as a violation.
  • 2 is only argparse rejecting a flag (tirith lint --bogus, tirith platform check with a missing flag). An unknown subcommand exits 1, as does a platform timeout. Neither 1 nor 2 ever means a policy said no.
  • final_result: null is not a pass. Every check was skipped, nothing was evaluated, exit 1.
  • Without --fail-on-error the exit is always 0. Every real gate needs the flag.

Write a policy

Decide these four in order. Guessing any of them is the main source of silently broken policies.

  1. Document. Terraform or OpenTofu plan, Kubernetes manifest, Infracost breakdown, or arbitrary JSON or YAML. This fixes meta.required_provider. Five providers ship; there is no CloudFormation provider, a template is arbitrary JSON read by stackguardian/json.
  2. Operation. Each provider exposes a closed set: reference/schema.md.
  3. Key naming the value. It differs per provider, and a wrong key is ignored, not rejected, so the check reads nothing and passes: reference/schema.md.
  4. Condition. Thirteen, listed in reference/schema.md. There is no Exists.
json
{
  "meta": {
    "version": "v1",
    "required_provider": "stackguardian/terraform_plan",
    "name": "Every resource carries a costcenter tag"
  },
  "evaluators": [{
    "id": "costcenter_tag_present",
    "description": "Every taggable resource declares a costcenter tag",
    "provider_args": {
      "operation_type": "attribute",
      "terraform_resource_type": "*",
      "terraform_resource_attribute": "tags.costcenter"
    },
    "condition": {"type": "IsNotEmpty"}
  }],
  "eval_expression": "costcenter_tag_present"
}

eval_expression combines evaluator ids with &&, ||, ! and parentheses. An evaluator it never names cannot affect the verdict. ! is the only negation: write the positive detector and invert it.

Traps

  • error_tolerance goes inside condition. On the evaluator it is silently ignored. {"condition": {"type": "IsNotEmpty", "error_tolerance": 2}}
  • One evaluator, one result per matching resource. Three buckets give three results from one rule, and the check fails if any of them fails.
  • Missing attribute is severity 2, missing resource type is severity 1. With error_tolerance: 2 a resource lacking the attribute is skipped, not failed. If every evaluator is skipped the policy is final_result: null, exit 1. Skipping is not passing.
  • A type-scoped policy refuses a plan with none of that type. Severity 1 under the default tolerance is exit 3; with error_tolerance: 1 it is exit 1. Neither is 0; a count guard is. See reference/verdicts.md.
  • The delete action is spelled delete. "destroy" matches nothing and the guard exits 0. action emits one result per action: NotEquals "delete" blocks deletes and replacements, ContainedIn ["delete"] with ! blocks only a pure delete. See reference/terraform-plan.md.
  • An unknown condition.type exits 3, not 1. The message names it (`Exists` is not a supported evaluator) but errors is empty, so CI sees a violation. Check the type against the closed list, not your memory.
  • tirith lint catches most of the above before CI does, and needs no plan document. It ships from 1.2.1. reference/validate.md has the detail.
Show full SKILL.md (239 more words)Show less

Test it with the bundled example

examples/required-tags/ holds the policy above, a plan that violates it and one that satisfies it. Copy the pair and edit it when testing a new policy.

bash
cd examples/required-tags
tirith -policy-path policy.json -input-path should-fail.json --fail-on-error; echo $?   # 3
tirith -policy-path policy.json -input-path should-pass.json --fail-on-error; echo $?   # 0

Before you hand it back

  1. Does eval_expression reference every evaluator you wrote?
  2. Is every condition.type in the closed list of thirteen?
  3. Is the argument key the one this provider reads?
  4. Is error_tolerance, if used, inside condition?
  5. Did you run it against a document that should fail it, and did it exit 3?
  6. Did you run it against a document that should pass, and did it exit 0?

Reference

FileUse it for
reference/schema.mdThe closed vocabulary: conditions, providers, operations, argument keys
reference/validate.mdChecking a policy is well-formed with tirith lint, tirith fmt and the interface
reference/verdicts.mdRunning a policy, exit codes, and finding the resource behind a failure
reference/terraform-plan.mdThe plan provider's operations, for OpenTofu and Terraform
reference/other-providers.mdKubernetes, Infracost and arbitrary JSON or YAML
reference/variables.mdOne policy across environments with -var
reference/install.mdInstalling Tirith, and why the install is a git URL
reference/pipelines.mdGitHub Actions, GitLab CI, Bitbucket, Jenkins, Azure DevOps, CircleCI
reference/platform.mdEvaluating against an organization's central policies
reference/debug-ci.mdStarting from a red build and ending at the rule and the resource
examples/required-tags/A policy, a plan that fails it, and a plan that passes it

Translating existing Sentinel policies is a separate skill, tirith-migrate, installed alongside this one.

© StackGuardian, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 14 other files in .claude/skills/tirith-policies of StackGuardian/tirith.

  • SKILL.md
  • examples/required-tags/README.md
  • examples/required-tags/policy.json
  • examples/required-tags/should-fail.json
  • examples/required-tags/should-pass.json
  • reference/debug-ci.md
  • reference/install.md
  • reference/other-providers.md
  • reference/pipelines.md
  • reference/platform.md
  • reference/schema.md
  • reference/terraform-plan.md
  • reference/validate.md
  • reference/variables.md
  • reference/verdicts.md

Open the folder on GitHubat commit 85064b9

Compare with similar skills

Tirith Policies next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tirith Policies compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tirith Policies this skillStackGuardian/tirith170—~1.8kAutomated safety check: PassApache-2.0
Infrastructure Devops Devops Engineerchendongqi/OPB-Skills125—~1.4kAutomated safety check: PassNone
Megalinter Checknvuillam/npm-groovy-lint2481 repos~3.9kAutomated safety check: NotesMIT
APIOps Deployment for Azure APIMthomast1906/github-copilot-agent-skills202—~3.6kAutomated safety check: PassMIT
Eks Reconaws-samples/appmod-blueprints115—~4.7kAutomated safety check: WarnMIT-0
Playwright CIzebbern/claude-code-guide4.7k2 repos~675Automated safety check: PassMIT

Similar skills

  • DevOps助手 - 专业的DevOps实践与自动化专家。适用场景: (1) CI/CD流水线设计与实现 (2) 部署策略与发布管理 (3) 基础设施即代码(IaC) (4) 容器化与Kubernetes部署 (5) 监控告警与可观测性 (6) DevOps工具链选型 (7) DevOps文化与实践推广 触发关键词:DevOps、CI/CD、持续集成、持续部署、Jenkins、GitLab…

    125 GitHub stars~1.4k tokensUpdated 8 mo ago
    DevOps & CloudAuto-check passed
  • Megalinter Check

    nvuillam/npm-groovy-lint

    Collect MegaLinter lint errors for the current repository. An agent skill from nvuillam/npm-groovy-lint.

    248 GitHub starsUsed in 1 repo~3.9k tokens
    DevOps & CloudAuto-check: notes
  • APIOps Deployment for Azure APIM

    thomast1906/github-copilot-agent-skills

    Supplies Bicep and Terraform templates, CI/CD pipeline patterns and phased promotion plans for deploying Azure API Management with APIOps workflows.

    202 GitHub stars~3.6k tokensUpdated 2 days ago
    DevOps & CloudAuto-check passed
  • Eks Recon

    aws-samples/appmod-blueprints

    Official

    EKS cluster reconnaissance and environment discovery. An agent skill from aws-samples/appmod-blueprints.

    115 GitHub stars~4.7k tokensUpdated yesterday
    DevOps & CloudAuto-check: warnings
  • Playwright CI

    zebbern/claude-code-guide

    Production-ready CI/CD configurations for Playwright — GitHub Actions, GitLab CI, CircleCI, Azure DevOps, Jenkins, Docker, parallel sharding, reporting, code coverage, and global setup/teardown.

    4.7k GitHub starsUsed in 2 repos~675 tokens
    DevOps & CloudAuto-check passed
  • Newman Cicd Integration

    sickn33/agentic-awesome-skills

    Generate ready-to-use CI/CD pipeline configurations that install and run Newman for automated API testing.

    47k GitHub starsUsed in 1 repo~2.2k tokens
    DevOps & CloudAuto-check passed

More from StackGuardian/tirith

  • Tirith Migrate

    StackGuardian/tirith

    Translate existing policy-as-code into Tirith policies. An agent skill from StackGuardian/tirith.

    170 GitHub stars~1.7k tokensUpdated 2 days ago
    Auto-check passed
  • Tirith Standards

    StackGuardian/tirith

    Generate a Tirith policy set for an existing Terraform or OpenTofu repository, covering organization standards such as required tags, naming conventions, allowed regions, permitted resource types…

    170 GitHub stars~2k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Tirith Policies

What does Tirith Policies do?

Write, validate, run and debug Tirith IaC governance policies, install Tirith, and add it to a CI pipeline (GitHub Actions, GitLab CI, Bitbucket Pipelines, Jenkins, Azure DevOps, CircleCI or any…. Tirith Policies is an agent skill from StackGuardian/tirith. Write, validate, run and debug Tirith IaC governance policies, install Tirith, and add it to a CI pipeline (GitHub Actions, GitLab CI, Bitbucket Pipelines, Jenkins, Azure DevOps, CircleCI or any container runner).

When should I use Tirith Policies?

Tirith Policies fits situations like: editing files under .tirith/policies; A Tirith check fails in CI; asked to add a guardrail to a Terraform; openTofu pipeline.

How do I install Tirith Policies in Claude Code?

Run `npx skills add StackGuardian/tirith --skill tirith-policies -a claude-code`. Or copy the skill folder (.claude/skills/tirith-policies in StackGuardian/tirith) into .claude/skills/tirith-policies in your project. Claude Code loads it when a task matches its description.

How do I install Tirith Policies in Codex?

Run `npx skills add StackGuardian/tirith --skill tirith-policies -a codex`. Or copy the skill folder (.claude/skills/tirith-policies in StackGuardian/tirith) into .agents/skills/tirith-policies in your project. Codex loads it when a task matches its description.

Can I use Tirith Policies in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add StackGuardian/tirith --skill tirith-policies -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tirith-policies, .gemini/skills/tirith-policies, .github/skills/tirith-policies and .opencode/skills/tirith-policies in your project.

What does Tirith Policies need to run?

Going by SKILL.md and its folder, Tirith Policies needs the command-line tools its instructions call (pip). Our summary lists: Python 3.

Does Tirith Policies access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Tirith Policies safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tirith Policies use?

Tirith Policies is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tirith Policies use?

About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Tirith Policies?

Skills that share tags, products or a category with Tirith Policies: Infrastructure Devops Devops Engineer (chendongqi/OPB-Skills, 125 stars), Megalinter Check (nvuillam/npm-groovy-lint, 248 stars), APIOps Deployment for Azure APIM (thomast1906/github-copilot-agent-skills, 202 stars) and Eks Recon (aws-samples/appmod-blueprints, 115 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tirith Policies?

StackGuardian (a GitHub organization) maintains it in StackGuardian/tirith, which has 170 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 7, 2026.

Source: StackGuardian/tirith on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.