Prompt-Injection Defences for LLM Features in Rails
A practical guide to defending Rails apps against prompt injection: limiting what the model can do, treating its output as untrusted, gating side effects and testing for attacks.
Event software, connected hardware and web products, built on a fixed scope by a senior engineer. AI speeds up the work. Fifteen years of experience keeps it rock solid.
I'm Wagner Matos, based in Dorset and working remotely across the UK, US and Europe. Past clients include Johnson & Johnson, GSK, Citizens Advice, Babbel and Carwow.
Building for a congress stand?
Touchscreens, photo experiences and stand analytics, on the floor when the doors open.
The cloud, updates and remote access for devices on networks you do not control.
Step 1
A short call
Thirty minutes, free. Enough to tell whether I can help.
Step 2
For bigger builds, after the call: one paid week that turns your idea into a spec, an architecture and a fixed price.
Step 3
Build, launch and support
Working software at every milestone, then deployed, documented and supported.
Not a build? I also take contract engagements and fractional support. More on the services page.
When we hand Wagner a build with a hard deadline - a congress opening, a live event - it ships. Complete, working, on the floor when the doors open.
Wagner was enjoyable to work with. He was able to quickly get up to speed, immediately wrapping his brain around problems and shipping clear code to fix them.
Wagner handled our blog migration end to end including migrating all content, URLs and redirects for SEO, and a custom Cloudflare Worker. All documented and deployed with zero drama.
A practical guide to defending Rails apps against prompt injection: limiting what the model can do, treating its output as untrusted, gating side effects and testing for attacks.
How to keep the API bill for LLM features in a multi-tenant Rails app predictable, using per-tenant token budgets, response and prompt caching, and routing each request to the cheapest model that can handle it.
AI features in Rails can quietly get worse when you change a prompt or a model. This guide shows how to catch that with Minitest, fixtures, snapshots and a small eval suite.
A hands-on guide to exposing your Rails app's data and actions to AI assistants with the official Ruby MCP SDK: tools, authentication, Streamable HTTP and testing.
Get notified when I publish something new, and unsubscribe at any time.