ci-agent-guardrails

ci-agent-guardrails is a cursor rule for Cursor from nirarad/playwright-ai-qa-agent. It costs 630 tokens per session, scanned A, original, MIT.

A set of mandatory safety rules for an AI agent that responds to failed CI, the automated process that tests and builds code. The rules limit when the agent runs, what it can change, and how its actions are controlled and recorded.

In plain words
What is it for?
Use it when editing GitHub Actions workflows or AI failure-agent code to enforce trusted-event checks, write approvals, confidence thresholds, failure limits, safe branches, and sequential processing.
Why use it?
It reduces the risk of an AI agent making unsafe changes, especially in untrusted pull requests or after many failures.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/nirarad/playwright-ai-qa-agent/ci-agent-guardrails
Clone the repo
git clone --depth 1 https://github.com/nirarad/playwright-ai-qa-agent

Made for: Cursor.

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 ci-agent-guardrails

README.md
[![agentmods](https://agentmods.dev/badge/rules/nirarad/playwright-ai-qa-agent/ci-agent-guardrails.svg)](https://agentmods.dev/rules/nirarad/playwright-ai-qa-agent/ci-agent-guardrails)
Your own site
<a href="https://agentmods.dev/rules/nirarad/playwright-ai-qa-agent/ci-agent-guardrails"><img src="https://agentmods.dev/badge/rules/nirarad/playwright-ai-qa-agent/ci-agent-guardrails.svg" alt="Measured on agentmods" height="20"></a>
Per session 630 This file is loaded in full into every session.
When invoked 630 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00630 $0.00630
Opus 5 $0.00315 $0.00315
Sonnet 5 $0.00126 $0.00126
Haiku 4.5 $0.00063 $0.00063

Measured 5d ago against content hash f9bedef21ae3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ci-agent-guardrails 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 5d 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.

.cursor/rules/ci-agent-guardrails.mdc · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CI Agent Guardrails (Mandatory)

Apply this rule whenever editing CI workflow or AI agent code and docs.

Objective

Ensure the AI failure agent is safe-by-default when running in GitHub Actions. The agent must be bounded, auditable, and least-privilege.

Required Guardrails

  1. Run Conditions
  • Agent runs only after Playwright failure.
  • Agent must not run on cancelled workflows.
  • On untrusted fork PRs, do not perform write actions.
  1. Event and Branch Policy
  • Write actions are allowed only on trusted events:
    • push to approved branches
    • workflow_dispatch by maintainers
  • For pull_request, default to classify/log-only mode unless explicitly approved.
  1. Write Action Gates
  • Enforce explicit toggles for writes:
    • AGENT_ENABLE_BUG_ISSUE
    • AGENT_ENABLE_HEAL_PR
  • Keep healer disabled until reporter quality is validated.
  1. Confidence and Volume Controls
  • Enforce AGENT_CONFIDENCE_THRESHOLD before any write action.
  • Enforce AGENT_MAX_FAILURES_PER_RUN cap.
  • Process failures sequentially (no parallel write bursts).
  1. Target Safety
  • PR base branch must come from config and be allowlisted.
  • Branch names must be sanitized and length-limited.
  • Never force push, auto-merge, or commit directly to base branch.
  1. Permissions
  • Use least-privilege workflow permissions.
  • Grant write scopes only when the corresponding action is enabled:
    • issues: write for issue creation
    • pull-requests: write and contents: write for healer PR flow
  1. Secrets and Logging
  • API keys must come from GitHub Secrets only.
  • Never log secrets or raw sensitive payloads.
  • Log only redacted configuration values.
  1. Idempotency and Duplicate Prevention
  • Do not create duplicate issues for the same test/commit/category.
  • Do not open duplicate heal PRs for the same failing test in one run.
  1. Failure Semantics
  • Agent errors must not prevent artifact upload.
  • Job failure semantics must remain tied to Playwright test outcome.
  • Record agent outcome in run summary (success/skip/error and reason).

Read the full file on GitHub · 83 lines

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. 5d ago First seen · 83 lines · 630 tokens per session scan A f9bedef21ae3

Subscribe to this mod's changes

ci-agent-guardrails is a cursor rule published in the GitHub repository nirarad/playwright-ai-qa-agent (5 stars, last pushed 4mo ago), licensed MIT. It adds 630 tokens to every session, about $0.0032 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-31.