agentleFS
IgorGanapolskyIgorGanapolsky/mac-yolo-safeguards/.cursor/rules/agent-harness-router.mdc

mac-yolo-safeguards / rules

Cursor rule3 starsChanged 3 days agoMITView on GitHub

Trigger: When an agent needs to select a model, enforce budget, or capture a useful AI pattern This rule is loaded from .cursor/rules/ and is always active. This enforces the $10/mo budget cap and selects the best model by cost/latency/quality.

The file

We split this agent-harness-router.mdc into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never captures keystrokes, clicks, or local Mac activity (fail-closed)

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 6,809 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
agent-harness-router.mdc
# Agent Harness Router — Auto-invocation Rule

> Trigger: When an agent needs to select a model, enforce budget, or capture a useful AI pattern
> This rule is loaded from .cursor/rules/ and is always active.

## When to invoke agent-harness-router

1. **Model selection** — Before calling any LLM API, run:
   ```bash
   node tools/agent-harness-router.js route '{"requiresTools":true,"category":"coding","preference":"balance"}'
   ```
   This enforces the $10/mo budget cap and selects the best model by cost/latency/quality.

2. **Session start** — Automatically runs via `~/.claude/settings.json` SessionStart hook.
   ```bash
   node tools/agent-harness-router.js check --json
   ```

3. **Every user prompt** — Automatically runs via `~/.claude/settings.json` UserPromptSubmit hook.

4. **Useful prompt discovery** — When a prompt/task produces good results, capture it:
   ```bash
   node tools/agent-harness-router.js discover "<prompt>" --model <modelId> --task <taskType> --tags <tag1,tag2>
   ```

## Safety guarantees

- Never captures keystrokes, clicks, or local Mac activity (fail-closed)
- Budget enforcement: $10/mo hard cap, fail-closed
- Secret rejection: blocks AWS keys, GitHub PATs, JWTs, Bearer tokens in discoveries
- Input-capture refusal: blocks Computer History / event_tap / keystroke data
- Third-party models blocked when budget exhausted or sensitive data required

## Related articles
- TrueFoundry TrueForge (The NewStack): harness as control point
- Martech: scattered AI discovery capture
- GLM-5.3 (The NewStack): private benchmark validation, model portability
- Futurism: ChatGPT Computer History fail-closed alternative

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.