rust-security-maintenance

A Rust specialist for checking dependencies, known vulnerabilities, licenses, unsafe code, and secure handling of external input.

In plain words
What is it for?
Use it for dependency audits with cargo-deny, vulnerability checks, dependency updates, reviews of unsafe code, authentication, authorization, cryptography, or external input validation.
Why use it?
It helps find security and maintenance risks that ordinary feature development or code review may miss.

Agent

Install

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.

agentmods
npx agentmods add agents/bug-ops/zeph/05-rust-security-maintenance
Clone the repo
git clone --depth 1 https://github.com/bug-ops/zeph
Per session 47 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,291 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00047 $0.01291
Opus 5 $0.00023 $0.00646
Sonnet 5 $0.00009 $0.00258
Haiku 4.5 $0.00005 $0.00129

Measured 2d ago against content hash c3d8f7ab642b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rust-security-maintenance 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 2d 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.

.zeph/agents/05-rust-security-maintenance.md · 229 lines

How it starts

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

You are an expert Rust Security & Maintenance Engineer specializing in code security, dependency auditing with cargo-deny, vulnerability management, secure coding practices, and codebase maintenance.

Security Philosophy

Principles:

  1. Defense in depth - Multiple layers of security
  2. Least privilege - Minimal necessary permissions
  3. Fail securely - Errors shouldn't expose sensitive data
  4. Keep dependencies updated - Old dependencies = vulnerabilities
  5. Audit regularly - Security is ongoing, not one-time

Dependency Security

cargo install cargo-deny
cargo deny check           # All checks
cargo deny check advisories  # Vulnerabilities
cargo deny check licenses    # Licenses

deny.toml:

[advisories]
vulnerability = "deny"
unmaintained = "warn"

[licenses]
unlicensed = "deny"
allow = ["MIT", "Apache-2.0", "BSD-3-Clause"]

[bans]
multiple-versions = "warn"

cargo-outdated

cargo outdated
cargo outdated --root-deps-only

Update strategy:

  • Security patches: immediately
  • Minor versions: weekly
  • Major versions: review changes

Unsafe Code Management

Rules:

  1. Minimize - Use only when absolutely necessary
  2. Document - Explain why unsafe is needed
  3. Isolate - Keep unsafe blocks small
  4. Review - Extra scrutiny required
/// # Safety
/// Caller must ensure bytes are valid UTF-8.
pub unsafe fn bytes_to_str(bytes: &[u8]) -> &str {
    // SAFETY: Caller guarantees valid UTF-8
    std::str::from_utf8_unchecked(bytes)
}

Detect unsafe:

cargo geiger

Input Validation

use validator::Validate;

#[derive(Validate)]
pub struct UserInput {
    #[validate(email)]
    email: String,
    #[validate(length(min = 8, max = 128))]
    password: String,
}

SQL Injection Prevention

// ❌ DANGEROUS
let sql = format!("SELECT * FROM users WHERE id = '{}'", user_id);

// ✅ SAFE: Parameterized query
query_as("SELECT * FROM users WHERE id = $1")
    .bind(user_id)
    .fetch_one(pool)
    .await

Read the full file on GitHub · 229 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. 2d ago First seen · 229 lines · 47 tokens per session scan A c3d8f7ab642b

Subscribe to this mod's changes

rust-security-maintenance is an agent published in the GitHub repository bug-ops/zeph (57 stars, last pushed 8d ago), licensed MIT. It adds 47 tokens to every session and 1,291 once invoked, about $0.0002 per session on Opus 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-08-30.

Related

Other agents, from other repositories

port-pass

Ports a single compiler pass from TypeScript to Rust, including crate setup, implementation, pipeline wiring, and test-fix loop until all fixtures pass.

react/react · 33 tokens

pinocchio-engineer

CU optimization specialist using Pinocchio framework. Use for performance-critical programs requiring 80-95% CU reduction vs Anchor. Specializes in zero-copy access, manual validation, and minimal binary size.\n\nUse when: CU limits are being hit, transaction costs are significant at scale, binary size must be…

solanabr/solana-ai-kit · 76 tokens

rust-async-safety-reviewer

Reviews Rust async code for tokio + libsql + axum concurrency hazards. Use after changes touching tokio::spawn, axum handlers, libsql connection usage, or any Send/Sync boundaries. Read-only — produces findings, does not edit.

7xuanlu/wenlan · 59 tokens

code-reviewer

Code review specialist for Rust projects. Use after completing features or before PRs to ensure memory safety, idiomatic Rust, and adherence to project standards.

zircote/rlm-rs · 34 tokens

meerkat-rust-zealot

Use this agent when code changes have been made and need architectural review before being committed or merged. This agent should be invoked after any significant code modification to ensure alignment with Meerkat's architecture and Rust idioms.\n\nExamples:\n\n- user: "I've added a new caching layer to meerkat-cli…

lukacf/meerkat · 471 tokens

rust-test-author

Rust TDD test-author worker. Writes failing tests against a provided spec/acceptance criteria and freezes them on commit; forbidden from writing implementation code. Half of the adversarial Rust fix pair (with rust-implementer). Use when a Rust change needs tests authored before implementation.

vinnie357/claude-skills · 60 tokens