Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/Pranav-Karra-3301/tucknpx agentmods add rules/pranav-karra-3301/tuck/safetyWrote 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/pranav-karra-3301/tuck/safety)<a href="https://agentmods.dev/rules/pranav-karra-3301/tuck/safety"><img src="https://agentmods.dev/badge/rules/pranav-karra-3301/tuck/safety.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.1 | $0.00000 | $0.00415 |
| Opus 5 | $0.00000 | $0.00208 |
| Sonnet 5 | $0.00000 | $0.00083 |
| Haiku 4.5 | $0.00000 | $0.00042 |
Grade A, and why
safety 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 6d 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.
What it actually says
Safety Rules
Core Safety Principles
- Never lose user data - This is the most important rule
- Confirm destructive actions - Always ask before deleting/overwriting
- Create backups - Before any file modification
- Validate all input - Use Zod schemas
Destructive Operations
ALWAYS confirm before:
- Deleting files
- Overwriting files
- Removing tracked files
- Resetting configuration
// Required pattern
const confirmed = await prompts.confirm(
'This will delete all backups. Continue?',
false // Default to safe option
);
if (!confirmed) {
prompts.cancel('Operation cancelled');
return;
}
Backup Requirements
Before modifying any user file:
- Create a backup copy
- Store backup location
- Provide restore path in error messages
// Create backup before modification
const backupPath = await createBackup(originalPath);
try {
await modifyFile(originalPath);
} catch (error) {
throw new Error(`Failed. Restore from: ${backupPath}`);
}
Secrets and Credentials
NEVER:
- Store API keys in tracked files
- Track SSH private keys
- Include passwords in config
- Log sensitive data
Input Validation
Use Zod for ALL external data:
- Config file contents
- Manifest file contents
- User-provided paths
- Environment variables
import { ConfigSchema } from '../schemas/config.schema.js';
const data = JSON.parse(fileContent);
const config = ConfigSchema.parse(data); // Throws if invalid
Path Handling
ALWAYS use path utilities:
expandPath()- Expand ~ to full pathcollapsePath()- Collapse home to ~pathExists()- Check existence safely
NEVER:
- Assume path format
- Use raw ~ in fs operations
- Hardcode paths
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.
- 6d ago First seen · 88 lines · 0 tokens per session scan A 8aa85fca330e
safety is a cursor rule published in the GitHub repository Pranav-Karra-3301/tuck (15 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 415 tokens. 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-30.
Other cursor rules, from other repositories
rule-generating-agent
This rule is essential for maintaining consistency and quality in rule creation across the codebase. It must be followed whenever: (1) A user requests a new rule to be created, (2) An existing rule needs modification, (3) The user asks to remember certain behaviors or patterns, or (4) Future behavior changes are…
testing-mocks-spies-stubs-agent
Apply when writing unit tests that involve functions or modules with side effects (e.g., file system access, network requests, database interactions, timers, complex dependencies). Guides the use of test doubles like mocks, spies, and stubs (using frameworks like Jest) to isolate the unit under test and control its…
cli-configuration-management-agent
Apply when implementing or discussing configuration management strategy for any CLI tool. Ensures a clear order of precedence (args > env > project config > user config > system config), use of standard config file locations (e.g., XDG Base Directory spec), support for environment variables, and secure persistence of…
testing-isolation-logic-agent
Apply when designing or refactoring CLI command implementations or writing unit tests for them. Promotes separating the core business logic of a command from I/O operations (argument parsing, console output, file system access, network requests) to enhance testability. Encourages testing the isolated logic functions…
npm-cli-packaging-agent
Apply when preparing a TypeScript CLI tool for distribution via npm, specifically when configuring package.json, handling executables, and considering cross-platform compatibility. Covers the bin field, shebang line (#!/usr/bin/env node), pre-publish checks, installation instructions, and Node engine compatibility.
ts-dependency-management-agent
Apply when adding, removing, or managing dependencies, or when structuring code modules in a TypeScript project, especially for CLIs. Promotes minimizing external dependencies, using lockfiles (package-lock.json), vetting dependencies, following SOLID principles for modular code, and using dependency injection for…