agentleFS
thejefflarsonthejefflarson/soundcheck/.claude/skills/model-theft/SKILL.md

model-theft

Skill20 starsChanged 4 months agoMITView on GitHub

Detects inference endpoints without authentication or throttling, allowing

The file

We split this skill 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:

    No monitoring for systematic/grid-search query patterns that signal extraction attempts

    line 23

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
SKILL.md

Model Theft (OWASP LLM10:2025)

What this checks

Prevents unauthorized replication of proprietary models through API abuse. Unauthenticated or unthrottled inference endpoints let attackers systematically query a model to reconstruct its weights or distill a clone — stealing the commercial and IP value of the deployment.

Vulnerable patterns

  • Inference endpoint has no authentication — any client can query freely
  • Rate limiting applied per IP only, trivially bypassed with rotating proxies
  • Response includes raw logprobs or full embedding vectors, enabling extraction
  • No monitoring for systematic/grid-search query patterns that signal extraction attempts

Fix immediately

Flag the vulnerable code and explain the risk. Then suggest a fix that establishes these properties:

  1. Every inference endpoint requires authentication — API key, bearer token, or mTLS. Unauthenticated endpoints are free training data for anyone who wants to clone the model.
  2. Rate limits are keyed on the authenticated principal, not the IP. IP-only throttles are defeated by rotating proxies and residential IP pools; a per-user or per-key quota follows the attacker even as IPs churn.
  3. Extraction-signal fields are stripped from responses. Log-probabilities, full embedding vectors, and per-token probabilities are the primary signals distillation attacks use to reconstruct a model. If a caller does not strictly need them, do not return them.
  4. Query patterns are monitored for extraction signatures — high-volume, low-entropy, systematic grid-search probes. Alerts fire on anomalies; the handler records user identity, timestamp, and prompt (or a content fingerprint) for after-the-fact investigation.

Translate each principle to the serving framework, auth provider, and rate-limiter of the audited file. Use the framework's documented authentication and throttling middleware — do not roll your own.

Verification

  • Every inference endpoint requires a valid API key or bearer token
  • Rate limits are enforced per authenticated user, not per IP address
  • Log-probabilities, raw embeddings, and weight data are excluded from API responses
  • Query logs include user identity, timestamp, and either the prompt itself or a stable fingerprint (hash, embedding, or normalized form) sufficient to detect content-pattern anomalies. Logging only metadata (length, token count, request id) without any reconstructable prompt signal does not satisfy this. Choice between raw prompt and fingerprint is a privacy tradeoff — document the decision.

References

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.