RIPDPI: Agent for Claude Code

.claude/agents/unsafe-code-auditor.md

unsafe-code-auditor is an agent for Claude Code from po4yka/RIPDPI. It costs 39 tokens per session (1,834 once invoked), scanned A, original, BSD-3-Clause.

A safety auditor for unsafe Rust code, meaning Rust code that bypasses some of the language's normal memory protections. It reviews those sections, checks their safety explanations, runs Miri where possible, and groups the risks.

In plain words
What is it for?
Use it when adding or changing unsafe Rust, or during a periodic audit, to inventory unsafe blocks, check required safety comments, validate testable code with Miri, and assess risk.
Why use it?
It helps detect undefined behavior before unsafe code causes crashes, corrupted data, or security problems. Categorising each use makes it clearer which risks come from pointers, system calls, foreign-code interfaces, or other low-level operations.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is po4yka/RIPDPI's own configuration. It tells Claude Code how to work on RIPDPI 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 RIPDPI configures →

Reuse

Borrowing it

Nothing to install: this file belongs to po4yka/RIPDPI. 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/po4yka/RIPDPI/main/.claude/agents/unsafe-code-auditor.md
Clone the repo
git clone --depth 1 https://github.com/po4yka/RIPDPI

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 unsafe-code-auditor

README.md
[![agentmods](https://agentmods.dev/badge/agents/po4yka/ripdpi/unsafe-code-auditor/github.svg)](https://agentmods.dev/agents/po4yka/ripdpi/unsafe-code-auditor)
Your own site
<a href="https://agentmods.dev/agents/po4yka/ripdpi/unsafe-code-auditor"><img src="https://agentmods.dev/badge/agents/po4yka/ripdpi/unsafe-code-auditor/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.

agentmods 80×15 button for unsafe-code-auditor

Your own site · 80×15
<a href="https://agentmods.dev/agents/po4yka/ripdpi/unsafe-code-auditor"><img src="https://agentmods.dev/badge/agents/po4yka/ripdpi/unsafe-code-auditor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,834 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00039 $0.01834
Opus 5.5 $0.00016 $0.00734
Sonnet 5.5 $0.00008 $0.00367
Haiku 4.5 $0.00004 $0.00183

Measured yesterday against content hash 1bc74b911df9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

unsafe-code-auditor 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 yesterday.

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.

.claude/agents/unsafe-code-auditor.md · 149 lines

How it starts

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

You are an unsafe Rust auditor for the RIPDPI project (workspace at native/rust/).

Unsafe Hotspots

Known concentrations (verify current state before auditing):

  • ripdpi-desync-runtime/, ripdpi-runtime-platform/, and ripdpi-privileged-ops/ -- desync packet execution, platform socket ops, and privileged raw-packet helpers
  • ripdpi-runtime-platform/src/{socket_options.rs,raw_packet.rs,ip_fragmentation/} and ripdpi-privileged-ops/src/linux/ -- raw syscalls, socket options
  • ripdpi-root-helper/ -- privileged socket handling, TCP_REPAIR, SCM_RIGHTS
  • ripdpi-android-vpn-protect-adapter/src/lib.rs -- JNI thread attachment and VPN socket protection
  • ripdpi-vless/src/reality.rs -- protocol implementation

Audit Workflow

  1. Inventory: rg 'unsafe' native/rust/ --type rust -c to count per-file
  2. Categorize each unsafe block by reason:
    • FFI boundary (JNI, libc, boring-ssl)
    • Raw pointer manipulation
    • Transmute / type punning
    • Inline assembly
    • Raw syscall
    • Union field access
    • Mutable static access
  3. Validate SAFETY comments: every unsafe block must have a // SAFETY: comment
  4. Run Miri on testable modules: cd native/rust && cargo +nightly miri test --locked -p <crate> -- <test>
  5. Check for UB patterns (see checklist below)

UB Pattern Checklist

Aliasing

  • No &T and &mut T to same memory simultaneously
  • Raw pointer casts checked: *const T as *mut T is a red flag
  • Pin invariants respected for self-referential structs

Alignment

  • read_unaligned / write_unaligned used for network packet parsing (not ptr::read)
  • Struct alignment matches C ABI when crossing FFI (#[repr(C)])
  • alloc::Layout alignment correct for custom allocations

Lifetime & Provenance

  • Pointers derived from references don't outlive the borrow
  • No dangling pointers after Vec::as_ptr() followed by Vec mutation
  • transmute lifetime extensions flagged as high-risk

Atomics & Concurrency

  • Memory ordering justified (not defaulting to Relaxed)
  • SeqCst used when unclear (safe default)
  • No data races on non-atomic shared state

Read the full file on GitHub · 149 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. yesterday First seen · 149 lines · 39 tokens per session scan A 1bc74b911df9

Subscribe to this mod's changes

unsafe-code-auditor is an agent published in the GitHub repository po4yka/RIPDPI (85 stars, last pushed yesterday), licensed BSD-3-Clause. It adds 39 tokens to every session and 1,834 once invoked, about $0.0002 per session on Opus 5.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-11-07.

Related

unsafe-code-auditor compared with agents from other repositories

unsafe-code-auditor next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
unsafe-code-auditorpo4yka/RIPDPIAgent85yesterdayBSD-3-ClauseA39Claude Code
rust-audio-engineergertsylvest/meta-teamAgent55d agoMITA69Claude Code
ciel-systems-guildjxoesneon/CielAgent18d agoApache-2.0A32Claude Code
rust-reviewerleandrosilvaferreira/claude-plugins-registryAgent94d agononeA44Claude Code
cicd-devopsbug-ops/claude-pluginsAgent1214d agononeA79Claude Code
rust-prodotclaude/marketplaceAgent437mo agoMITA59Claude Code
android-kotlin-corekrutikJain/android-agent-skillsAgent147mo agoMITA31Claude Code