guard-src-drift-api

guard-src-drift-api is a skill for Claude Code, Codex from mick-gsk/drift. It costs 78 tokens per session (1,090 once invoked), scanned A, original, MIT.

A code-change guide for Drift’s public API folder, `src/drift/api/`. This folder contains the entry points used by agents and MCP tools, where MCP means a standard way for software tools to communicate with an AI agent.

In plain words
What is it for?
Use it when adding or changing an API function or MCP handler, or when repeated Drift findings point to this folder; use a different guide for command-line-only changes.
Why use it?
It helps keep public functions consistent when they connect internal modules, handle errors, return data, or expose agent instructions.

Skill for Claude CodeCodex

Part of the drift plugin — 31 skills, 17 agents shipped together

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 skills/mick-gsk/drift/guard-src-drift-api
Any agent
npx skills add mick-gsk/drift --skill guard-src-drift-api
Clone the repo
git clone --depth 1 https://github.com/mick-gsk/drift

Made for: Claude Code, Codex.

Or install drift, the plugin that ships this one along with the rest of its 31 skills, 17 agents.

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 guard-src-drift-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/mick-gsk/drift/guard-src-drift-api.svg)](https://agentmods.dev/skills/mick-gsk/drift/guard-src-drift-api)
Your own site
<a href="https://agentmods.dev/skills/mick-gsk/drift/guard-src-drift-api"><img src="https://agentmods.dev/badge/skills/mick-gsk/drift/guard-src-drift-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,090 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.00078 $0.01090
Opus 5 $0.00039 $0.00545
Sonnet 5 $0.00016 $0.00218
Haiku 4.5 $0.00008 $0.00109

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

Security

Grade A, and why

guard-src-drift-api 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 5d 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.

.github/skills/guard-src-drift-api/SKILL.md · 75 lines

How it starts

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

Guard: src/drift/api

src/drift/api ist die einzige legitime Eintrittspforte fuer alle Agenten- und MCP-Aufrufe. Jede Datei hier (scan.py, fix_plan.py, steer.py, nudge.py, brief.py, suggest_rules.py, generate_skills.py, diff.py, verify.py) repraesentiert genau einen oeffentlichen Vertrag.

Konfidenz: 0.95 — EDS und PFS treten wiederholt auf, weil API-Funktionen interne Submodule direkt verdrahten statt sauber zu delegieren.

When To Use

  • Du fuegest eine neue oeffentliche API-Funktion hinzu oder aenderst eine bestehende
  • Du implementierst einen neuen MCP-Tool-Handler
  • Du rufst intern pipeline.py, analyzer.py oder scoring/ direkt aus einer neuen Funktion auf
  • Drift meldet EDS oder PFS fuer eine Datei in src/drift/api/

Nicht benutzen fuer reine CLI-Aenderungen — dafuer gibt es guard-src-drift-commands.

Warum dieses Modul kritisch ist

Signal Ursache in diesem Modul
EDS API-Funktionen greifen direkt auf pipeline.py, analyzer.py, scoring/ und output/ zu — je mehr Abhaengigkeiten, desto hoeher EDS
PFS Verschiedene API-Funktionen handhaben Fehler, Rueckgabetypen und agent_instruction-Felder unterschiedlich — inkonsistente Muster

Core Rules

  1. Eine API-Funktion = ein Vertrag — jede Datei in src/drift/api/ darf genau einen Eintrittspunkt nach aussen haben. Hilfsfunktionen, die von mehreren API-Funktionen benoetigt werden, gehoeren in _util.py.

  2. Keine Pipeline-Direktaufrufe — API-Funktionen duerfen nicht direkt pipeline.run() oder Analyzer() instanziieren. Der Einstiegspunkt geht ueber _config.py-Konfiguration und gemeinsame Bootstrapping-Logik.

  3. agent_instruction-Feld immer setzen — alle API-Rueckgabe-Dicts muessen agent_instruction enthalten. PFS steigt wenn manche Funktionen es weglassen oder anders benennen.

  4. Kein Output-Formatting in der API — API-Funktionen geben strukturierte Dicts zurueck, KEIN Rich-Text, kein Markdown, kein formatted String. Formatting gehoert in src/drift/output/.

Read the full file on GitHub · 75 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. 5d ago First seen · 75 lines · 78 tokens per session scan A 67a5c6f2dea2

Subscribe to this mod's changes

guard-src-drift-api is a skill published in the GitHub repository mick-gsk/drift (14 stars, last pushed 1mo ago), licensed MIT. It adds 78 tokens to every session and 1,090 once invoked, about $0.0004 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.