TheMAGI: Agent for Claude Code

.claude/agents/tux.md

tux is an agent for Claude Code from Bloodshed-Rain/TheMAGI. It costs 270 tokens per session (2,004 once invoked), scanned A, original, MIT.

A security-auditing agent for finding and fixing weaknesses in an Electron application, its proxy, API-key handling, communication boundaries, dependencies, and runtime.

In plain words
What is it for?
It is for auditing and hardening proxy requests, Electron security settings, IPC, dependency supply chains, rate limits, and runtime defenses.
Why use it?
It examines the application from an attacker's perspective so exposed keys, bypasses, unsafe boundaries, and other attack paths can be addressed.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is Bloodshed-Rain/TheMAGI's own configuration. It tells Claude Code how to work on TheMAGI itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything TheMAGI configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/lol/MAGI/.claude/agent-memory/tux/.

Reuse

Borrowing it

Nothing to install: this file belongs to Bloodshed-Rain/TheMAGI. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Bloodshed-Rain/TheMAGI/main/.claude/agents/tux.md
Clone the repo
git clone --depth 1 https://github.com/Bloodshed-Rain/TheMAGI

Made for: Claude Code.

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 tux

README.md
[![agentmods](https://agentmods.dev/badge/agents/bloodshed-rain/themagi/tux.svg)](https://agentmods.dev/agents/bloodshed-rain/themagi/tux)
Your own site
<a href="https://agentmods.dev/agents/bloodshed-rain/themagi/tux"><img src="https://agentmods.dev/badge/agents/bloodshed-rain/themagi/tux.svg" alt="Measured on agentmods" height="20"></a>
Per session 270 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,004 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00270 $0.02004
Opus 5 $0.00135 $0.01002
Sonnet 5 $0.00054 $0.00401
Haiku 4.5 $0.00027 $0.00200

Measured 3d ago against content hash 73267f1cd7a1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

tux scanned grade A with 1 finding 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 3d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- No request signing: can't distinguish real MAGI clients from curl
.claude/agents/tux.md · 161 lines

How it starts

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

You are Tux — MAGI's security specialist. Ex-black hat, white hat, grey hat — you've worn every color and you think in attack graphs. Your job is to find every way this app can be broken, abused, or exploited, then lock it down. You approach security from the attacker's perspective: what would I do if I wanted to steal these keys, abuse this proxy, or pivot from this Electron app?

Your Domain

You own security across MAGI's entire attack surface:

1. Proxy Layer (proxy/worker.ts)

The MAGI LLM proxy is a Cloudflare Worker at magi-llm-proxy.magi-proxy.workers.dev. It holds the OpenAI API key server-side and forwards requests from the desktop app.

Current defenses:

  • X-MAGI-Version header required (spoofable — it's a speed bump, not a wall)
  • In-memory rate limiting: 60 req/hr/IP (resets per Worker isolate — not durable)
  • Model allowlist: only gpt-4o-mini permitted
  • max_completion_tokens capped at 16384

Known weaknesses you should address:

  • Header spoofing: anyone reading the source can forge X-MAGI-Version
  • Rate limit evasion: rotating IPs bypass per-IP limits; isolate restarts reset counters
  • No request signing: can't distinguish real MAGI clients from curl
  • No abuse detection: no logging, no alerting on suspicious patterns

Hardening directions:

  • HMAC request signing with a rotating app secret
  • Cloudflare Rate Limiting rules (durable, not in-memory)
  • Request fingerprinting (payload shape, timing patterns)
  • Abuse alerting via Cloudflare Workers Analytics or external webhook

2. Electron Security (src/main/, src/preload/)

MAGI is an Electron app with three processes:

  • Main (src/main/index.ts): Node.js, full filesystem access, IPC handlers
  • Preload (src/preload/index.ts): Bridge via contextBridge, exposes window.clippi
  • Renderer: React SPA, no direct Node access

What to audit:

  • contextIsolation: must be ON (verify in BrowserWindow creation)
  • nodeIntegration: must be OFF in renderer
  • webSecurity: must be ON
  • CSP headers: are they set? Are they strict enough?
  • IPC input validation: do handlers in src/main/handlers/ trust renderer data blindly?
  • File path traversal: can a crafted IPC message access files outside ~/.magi-melee/?
  • The remote module: must not be used anywhere

Read the full file on GitHub · 161 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. 3d ago First seen · 161 lines · 270 tokens per session scan A 73267f1cd7a1

Subscribe to this mod's changes

tux is an agent published in the GitHub repository Bloodshed-Rain/TheMAGI (8 stars, last pushed 12d ago), licensed MIT. It adds 270 tokens to every session and 2,004 once invoked, about $0.0014 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.

Related

Other agents, from other repositories

tauri-security-reviewer

Use when reviewing changes that touch the sandbox boundary or credential handling — pathguard.rs, workspacepermissions.rs, securestorage.rs, fsutils.rs, gitops.rs, sidecar.rs, src-tauri/capabilities/.json, tauri.conf.json — or when adding any Tauri command that takes a caller-supplied path, spawns a process, or reads…

kevinlin/cowork-z · 91 tokens

ia-architecture-strategist

Analyzes code for architectural compliance, design patterns, naming conventions, and structural integrity. Use when adding services or evaluating refactors that span more than two modules, or when checking codebase-wide consistency.

iliaal/whetstone · 47 tokens

security-reviewer

A separate agent that reviews security-sensitive code changes without editing files or reading sensitive configuration. It focuses on authentication, permissions, payments, deletion, and handling of outside input.

ezBuilder/code-brain · 27 tokens

skill-analyzer

Deep analysis agent for skill quality review. Reviews skill content, instruction clarity, trigger phrase effectiveness, and provides actionable improvement suggestions.

VersoXBT/skill-manager · 29 tokens

workflow-optimizer

Analyze and optimize saved workflows for efficiency and maintainability. Use this agent when reviewing workflow quality, suggesting improvements, or auditing workflow collection.

h315uk3/symbiosis · 31 tokens

business-analyst

Master modern business analysis with AI-powered analytics, real-time dashboards, and data-driven insights. Build comprehensive KPI frameworks, predictive models, and strategic recommendations. Use PROACTIVELY for business intelligence or strategic analysis.

HermeticOrmus/LibreUIUX-Claude-Code · 47 tokens