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.
npx agentmods add rules/nirarad/playwright-ai-qa-agent/ci-agent-guardrailsgit clone --depth 1 https://github.com/nirarad/playwright-ai-qa-agentWrote 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.
[](https://agentmods.dev/rules/nirarad/playwright-ai-qa-agent/ci-agent-guardrails)<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>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.
| Model | Per session | Once 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 |
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.
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
- Run Conditions
- Agent runs only after Playwright failure.
- Agent must not run on cancelled workflows.
- On untrusted fork PRs, do not perform write actions.
- Event and Branch Policy
- Write actions are allowed only on trusted events:
pushto approved branchesworkflow_dispatchby maintainers
- For
pull_request, default to classify/log-only mode unless explicitly approved.
- Write Action Gates
- Enforce explicit toggles for writes:
AGENT_ENABLE_BUG_ISSUEAGENT_ENABLE_HEAL_PR
- Keep healer disabled until reporter quality is validated.
- Confidence and Volume Controls
- Enforce
AGENT_CONFIDENCE_THRESHOLDbefore any write action. - Enforce
AGENT_MAX_FAILURES_PER_RUNcap. - Process failures sequentially (no parallel write bursts).
- 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.
- Permissions
- Use least-privilege workflow permissions.
- Grant write scopes only when the corresponding action is enabled:
issues: writefor issue creationpull-requests: writeandcontents: writefor healer PR flow
- Secrets and Logging
- API keys must come from GitHub Secrets only.
- Never log secrets or raw sensitive payloads.
- Log only redacted configuration values.
- 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.
- 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).
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.
- 5d ago First seen · 83 lines · 630 tokens per session scan A f9bedef21ae3
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.
Other cursor rules, from other repositories
agents-shipgate
Run Agents Shipgate as the deterministic merge gate for AI-generated agent capability changes.
beanstalk-deploy
Robust deployment patterns for Elastic Beanstalk with GitHub Actions, Pulumi, and edge case handling.
workflow-ci
Testing and verification workflow expectations.
infra-devops
Infrastructure, Cloud, Terraform, Docker & CI/CD Agent.
testing-ci-rule
testing-ci-rule from DaunteEth/woofi-pro-mcp.
infrastructure
Terraform infrastructure-as-code standards for multi-cloud (AWS, GCP, Azure, OCI) provisioning.