security-guardrails

security-guardrails is a cursor rule for coding agents from jterratsdev/ableton-live-mcp. It costs 621 tokens per session, scanned A, original, MIT.

A set of non-negotiable security rules for handling user input, secrets, files, processes, network requests, dependencies, and sensitive features.

In plain words
What is it for?
Use it when processing external input, running shell commands, rendering web data, reading files, fetching URLs, managing secrets, or changing dependencies. It also identifies changes that require a security review.
Why use it?
It helps prevent command injection, cross-site scripting (XSS), path traversal, leaked credentials, and unsafe changes to authentication or infrastructure.

Cursor rule

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/jterratsdev/ableton-live-mcp/security-guardrails
Clone the repo
git clone --depth 1 https://github.com/jterratsdev/ableton-live-mcp

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 security-guardrails

README.md
[![agentmods](https://agentmods.dev/badge/rules/jterratsdev/ableton-live-mcp/security-guardrails.svg)](https://agentmods.dev/rules/jterratsdev/ableton-live-mcp/security-guardrails)
Your own site
<a href="https://agentmods.dev/rules/jterratsdev/ableton-live-mcp/security-guardrails"><img src="https://agentmods.dev/badge/rules/jterratsdev/ableton-live-mcp/security-guardrails.svg" alt="Measured on agentmods" height="20"></a>
Per session 621 This file is loaded in full into every session.
When invoked 621 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.00621 $0.00621
Opus 5 $0.00311 $0.00311
Sonnet 5 $0.00124 $0.00124
Haiku 4.5 $0.00062 $0.00062

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

Security

Grade A, and why

security-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 4d 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.

rules/security-guardrails.mdc · 41 lines

How it starts

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

Security Guardrails

These are non-negotiable. Violations must be fixed before code review.

Input Handling

  • No shell interpolation. Use array-based APIs (execFile, spawn with args array) instead of exec with template literals. This prevents command injection.
  • No raw innerHTML with dynamic data. Escape all user-provided values or use textContent + createElement. This prevents XSS.
  • Validate external input. URLs must start with https:// before fetch(). File paths must be within expected directories (no path traversal).
  • Security review is required for auth, authorization, identity, secrets, PII, payments, file paths, shell/process execution, network calls, dependency changes, encryption, TLS, cookies, sessions, CORS, webhooks, or infrastructure.

Secrets

  • Never hardcode credentials, tokens, API keys, or connection strings. Use environment variables, secret managers, or Named Credentials.
  • Files that may contain secrets (.env, credentials.json, *.pem, *.key) must be in .gitignore.
  • If a secret is accidentally committed, rotate it immediately — removing from git history is not enough.

Dependencies

  • Pin dependency versions in lockfiles. Review changelogs before major upgrades.
  • Never install packages from untrusted sources or run npx on unvetted packages in CI.
  • For full dependency policy, supply chain review, and update workflow, see dependency-management.mdc.

Static Analysis

  • Static analysis and secret scanning must run before commit and in CI.
  • For hook policy and tool categories, see static-analysis-githooks.mdc.

Error Exposure

  • Never return stack traces, internal paths, or database errors to end users. Log them server-side, show a generic message client-side.
  • Distinguish between expected errors (user input) and unexpected errors (bugs). Only unexpected errors should alert/log at error level.

Infrastructure & Data

  • For databases, encryption, IaC, environment segregation, secrets management, scalability, and vulnerability management, see infra-data-encryption.mdc.
  • Production networked services must consider TLS 1.2+, certificate management, HSTS where applicable, secure cookies, least privilege, and secret rotation.
  • Local Docker Compose, dev servers, databases, caches, observability tools, and admin UIs must bind published ports to 127.0.0.1 by default.
  • Binding to 0.0.0.0, [::], or a LAN interface is a security exception. It needs a linked task, explicit rationale, no default credentials, and a time-bounded review.
  • Never expose Redis, Postgres, admin consoles, Docker socket, or internal APIs on public/LAN interfaces unless Security approves the exact use case and compensating controls.

Read the full file on GitHub · 41 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. 4d ago First seen · 41 lines · 621 tokens per session scan A 436846eabd88

Subscribe to this mod's changes

security-guardrails is a cursor rule published in the GitHub repository jterratsdev/ableton-live-mcp (0 stars, last pushed 11d ago), licensed MIT. It adds 621 tokens to every session, about $0.0031 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.