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.
git clone --depth 1 https://github.com/sthamann/nyx-local-aiWrote 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/sthamann/nyx-local-ai/local-model-safety)<a href="https://agentmods.dev/rules/sthamann/nyx-local-ai/local-model-safety"><img src="https://agentmods.dev/badge/rules/sthamann/nyx-local-ai/local-model-safety/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/sthamann/nyx-local-ai/local-model-safety"><img src="https://agentmods.dev/badge/rules/sthamann/nyx-local-ai/local-model-safety.svg" alt="Reviewed on agentmods" width="80" 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.00528 |
| Opus 5 | $0.00000 | $0.00264 |
| Sonnet 5 | $0.00000 | $0.00106 |
| Haiku 4.5 | $0.00000 | $0.00053 |
Grade A, and why
local-model-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 10d 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 — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Local-model safety invariants
Special tokens never survive into persisted state
Leaked model tokens (DSML fragments, <|end▁of▁sentence|>) poison future
prompts: once stored in memory/sessions, models start imitating the junk.
stripSpecialTokens (src/models/client.ts) must therefore be applied at
these boundaries:
- assistant content at stream end (client.ts,
extractmode) - web-sourced tool results only (
fetch_url,web_searchin agent.ts) - memory writes and the one-time migration in
MemoryStore - stored histories in
AgentSession.loadMessages
Never sanitize file/command/MCP tool outputs (read_file, run_command,
…): the agent must see workspace content byte-faithfully — sanitizing file
reads once corrupted source that merely mentioned DSML tokens and sent a
model analyzing phantom bugs.
When adding a new boundary (new tool, new store), wire it in and add a case to
.harness/smoke.mjs.
Tool-call parsing changes require smoke tests
Any change to parsing in src/models/client.ts (JSON extraction, DSML,
function-style calls, repair) needs a matching test in .harness/smoke.mjs.
Run node .harness/smoke.mjs — it must print ALL PASS.
Other invariants
- Secrets: API keys live in
SecretStorageonly (MachineStore); never write them into settings, session files, or logs. The webview receiveshasApiKey, never the key. - File writes go through
applyWrite→WorkspaceEdit(undo/dirty-buffer safe) with checkpoint recording (recordCheckpointFile) and backups. Don't add directfs.writeFilepaths for workspace files. - Processes: anything long-running goes through
ProcessManagerso Stop (abort signal) actually kills it. No bareexecwithout a signal. - Untrusted content: anything fetched from the network is wrapped with
wrapUntrustedbefore entering the prompt;fetch_urlkeeps its SSRF guard. - Tool outputs are truncated (
truncate, 20k chars) — unbounded strings blow up the context and the session files.
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.
- 10d ago First seen · 49 lines · 0 tokens per session scan A 4d3573eac1f4
local-model-safety is a cursor rule published in the GitHub repository sthamann/nyx-local-ai (137 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 528 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
agents
A project rulebook that mirrors the instructions in AGENTS.md and points to the project's development, task-process, and architecture documents. It also identifies where the project's reusable skills are stored.
general-ai-assistant-instructions
General instructions for the AI assistant to follow when executing tasks, including analysis, execution, quality control, and reporting.
fastapi-components-and-validation
Specifies the use of functional components and Pydantic models for input validation in FastAPI routes.
accessibility
Rules for ensuring accessibility in Astro components, including semantic HTML and ARIA attributes.
check-x-md-content-rule
This rule reminds the AI to check the x.md file for the current file contents and implementations.
javascript-code-style-and-structure
Guidelines for JavaScript code style, naming conventions, and general usage within Chrome extensions.