Who it is forA Rust developer on a platform team who must enforce a rule, such as masking personal data, on all model traffic.
The problemModel traffic may contain personal data or policy-breaking content that must be filtered before it leaves the company.
The outcomeA custom plugin built on the gateway's one-trait, four-hook API runs on every request.
What you need first
- Python with pip, or a Rust toolchain with cargo, or Docker
- An API key for at least one model vendor, such as OPENAI_API_KEY
- An existing app or SDK that accepts a custom base URL
- Optional: a Respan API key for tracing and a tool vendor key for MCP tools
Steps
- Read the plugin guide at docs/plugins.md.
- Open the examples index at examples/README.md and pick the example closest to your rule, such as guardrails or PII masking.
- Implement the plugin trait's four hooks in Rust, following the example.
- Build the gateway with your plugin mounted, using the embed option in docs/plugins.md, then run the check command against your config. (inferred, check the README)
- Send a request containing test personal data and confirm the masked output in the live log.
Prompt for your agent
In the respan-gateway repo, read docs/plugins.md and examples/README.md, then write a Rust plugin that implements the four hooks for <rule>. Return the plugin file and the test request result, and verify that the masked value does not appear in the live log.
Caveat. The README describes the plugin API only at a high level, so the exact hook names and signatures must be taken from docs/plugins.md rather than assumed.
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page