Production hardening is the work that turns an AI prototype into software you can trust with real users, real data and a real budget. It means automating deployment, locking down data, models, APIs and agent permissions, testing against attacks before
release, rolling out in stages, and watching the app closely after launch. This guide walks through each step in the order we would do it.
If you built your app fast with AI tools, you are probably standing at the edge of the prototype trap: it works on your laptop and in the demo, and nobody is sure what happens under load, under attack or at 3 a.m. That last mile is what hardening covers.
TL;DR
- Hardening replaces manual proof-of-concept deployment with automated CI/CD, versioned stacks, security scanning, staging and monitoring.
- Start your threat list with the OWASP Top 10 for LLM Applications, then add limits, least privilege and kill switches for agents.
- Block releases when evaluation scores drop below a threshold you set in advance, and test adversarially for prompt injection, PII exposure and system-prompt leakage.
- After launch, log prompts, responses, token counts and tool calls, and alert on sudden spikes in cost or requests.
- Use NIST AI RMF as the governance frame, not as a checklist.
Table of Contents
- What production hardening means for an AI app
- Start with the threats you have to cover
- Lock down data, models, APIs and agent permissions
- Test before you ship, and make the tests block releases
- Roll out in stages with a way to stop
- Monitor after launch like the app can fail quietly
- Use a framework, but do not mistake it for a checklist
- Perspective
- Where to start: a 30-day hardening order
- How Bowtie helps harden your app
- FAQ
- Sources
What production hardening means for an AI app
AWS describes the shift in plain terms: replace manual proof-of-concept deployment with automated CI/CD, version the whole application stack, evaluate and security-scan every change, deploy to staging before promotion, and monitor performance, cost and quality. That is a good working definition.
Notice what is on the list and what is not. Almost none of it is about the model. It is about everything wrapped around the model: pipelines, permissions, limits, tests and alerts. A prompt that works in a notebook is a demo. A prompt that is versioned, tested, rate limited, logged and deployable by anyone on your team in ten minutes is a product.
NIST frames it as a lifecycle matter too. Its AI Risk Management Framework says risk management efforts should be performed throughout the AI system lifecycle, not once before launch. Hardening is therefore never finished. It is a habit you build into how the app ships.
We cover the broader question of what separates a demo from shippable code in our guide to production-ready AI code. This article goes deeper on the security and operations side.

Start with the threats you have to cover
You cannot harden against risks you have not named. The OWASP Top 10 for LLM Applications 2025 is the most practical starting list. It covers:
- Prompt injection
- Sensitive-information disclosure
- Supply-chain vulnerabilities
- Data and model poisoning
- Improper output handling
- Excessive agency
- System-prompt leakage
- Vector and embedding weaknesses
- Misinformation
- Unbounded consumption
Treat it as the minimum review for any app that calls a language model. For each item, write down one sentence: where could this happen in our app, and what stops it? If the second half of that sentence is blank, you have found your first hardening task.
A few of these deserve a closer look because we see them most in AI-generated and vibe-coded apps:
- Prompt injection. User text, or text pulled from a web page or document, convinces the model to ignore its instructions. We break down mitigation in detail in our piece on reducing LLM prompt injection success.
- Excessive agency. An agent has database write access, email access or payment tools because it was easier to wire up that way. One bad output becomes a real action.
- Unbounded consumption. No cap on tokens, retries or loops means one bug, or one abusive user, becomes a surprise invoice.
- Improper output handling. The app trusts model output and passes it straight to a browser, shell or SQL query.
Lock down data, models, APIs and agent permissions
The OWASP Secure AI Model Ops cheat sheet gives a concrete control set. It recommends access-controlled model registries, signed model binaries, encryption at rest, third-party model validation, authenticated and authorized inference APIs, input validation, rate limits, structured prompt templates, least-privilege access, isolated environments and scoped model-serving credentials.
Here is how that translates into a working checklist.
Data and models
- Keep models and prompt templates in a registry with access control, and version them like code.
- Validate any third-party model before it touches production data.
- Encrypt stored data and keep secrets out of prompts and repositories.
- Inventory every AI component and dependency. CISA’s guidance on AI in operational technology recommends exactly that inventory, and it is useful well beyond OT.
If compliance or privacy rules mean sensitive data cannot leave your environment, local model deployment is one option we build for. Regulated teams should also read our guide to mapping NIST to model risk management.
APIs and limits
- Authenticate and authorize every inference endpoint. An open endpoint that proxies to a paid model is a bill waiting to happen.
- Validate inputs and use structured prompt templates instead of concatenating raw user text.
- Set limits. OWASP recommends per-tenant request, token, concurrency and spend limits, plus recursion, retry and chain-depth limits for agentic flows.
Agent permissions
Give each agent the smallest set of tools it needs, run it in an isolated environment, and use scoped credentials that cannot be reused elsewhere. If an agent only needs to read orders, it should not hold a key that can refund them. For deeper governance patterns, see our engineer playbook on code audits and isolation for agentic AI.
Test before you ship, and make the tests block releases
The common failure is testing by feel: someone tries ten prompts, they look fine, and it ships. Hardening replaces that with repeatable gates.
AWS suggests combining unit, integration and end-to-end tests with evaluation against a versioned dataset, adversarial security scans and staging tests, and blocking builds when evaluation scores fall below a predefined threshold. The same page calls for adversarial tests covering prompt injection, PII exposure and system-prompt extraction before promotion.
NIST backs the principle. It says AI systems should be tested before deployment and regularly during operation, using documented, objective and repeatable processes. Microsoft’s guidance adds that you should write acceptance criteria down, formally test new systems and new versions, automate where you can and use production-like test environments.
A minimal test gate
| Gate | What it checks | Fails the build when |
|---|---|---|
| Unit and integration tests | Tool calls, parsing, API contracts | Any test fails |
| Evaluation set | Answer quality on a versioned dataset | Score drops below your threshold |
| Adversarial scan | Prompt injection, PII leaks, system-prompt extraction | Any new successful attack |
| Staging run | Behavior in a production replica | Errors, latency or cost out of range |
Pick the threshold before you see the results. Otherwise it drifts to whatever the current build scores. Our walkthrough of QA for AI applications, from TEVV to CI gates shows how to wire this into a pipeline.
One more rule from CISA: when you test, start in purpose-built non-production infrastructure and avoid exposing production data there. Copying the live customer database into staging to make tests realistic is a leak waiting to happen.
Roll out in stages with a way to stop
Even a well-tested AI app behaves differently with real traffic. Staged releases limit the blast radius.
- Automate the pipeline. One command or merge deploys. No hand-edited servers.
- Promote through staging. AWS recommends deploying passing changes to a production-replica staging environment, then using user acceptance testing, canary releases or A/B testing before broader rollout.
- Add kill switches. OWASP recommends circuit breakers or kill switches for abnormal cost, latency or tool-call spikes.
- Keep a human in the loop for critical actions. CISA calls for oversight mechanisms, failsafe mechanisms and AI in incident-response plans. In a business app, that often means an approval step before the agent sends money, deletes records or emails customers.
- Know how to roll back. If the new prompt or model version misbehaves, you should be able to return to the last known-good version fast.
Packaging also matters here. A containerized app behaves the same in staging and production, which removes a whole class of “it worked on my machine” surprises. We offer that as a fixed-scope service, covered below.
Monitor after launch like the app can fail quietly
AI apps rarely crash. They get worse, get expensive or get manipulated, and nothing throws an error. So monitoring has to look at more than uptime.
AWS advises that you centralize and correlate metrics, logs and traces, including prompts and responses, token counts, tool-call parameters and outputs, and user feedback, watch latency, errors, cost and quality, and feed what you learn back into retesting. OWASP adds near-real-time alerts on sudden changes in requests, tokens or spend.
CISA goes further, recommending logging inputs and outputs, keeping known-good states or safe-behavior thresholds, and using anomaly detection. It also wants incident-response plans that explicitly cover malicious activity against AI systems and AI-system failure. Microsoft recommends regular review of event and security logs, with consolidated alerts reviewed by management or security personnel.
What to put on the dashboard
- Requests, tokens and spend per user or tenant
- Latency and error rates, split by model and tool
- Quality signals: evaluation scores on sampled traffic, thumbs-up and thumbs-down
- Tool-call volume and failures for agents
- Security signals: blocked injections, refused outputs, unusual access patterns
Be deliberate about what you log. Prompts and responses can contain personal data, so decide retention and access rules up front. For a deeper treatment, read our practical guide to AI observability.
Use a framework, but do not mistake it for a checklist
For governance, NIST AI RMF 1.0 is the U.S. reference. It is a voluntary, use-case-agnostic framework organized around Govern, Map, Measure and Manage, and NIST states that these are not a checklist or necessarily ordered steps. It also identifies post-deployment monitoring, incident and error tracking, recalibration and response as continuing operational activities.
The RAND guide to securing AI models is another useful companion. It takes a risk-based approach to identifying model risks and prioritizing practical controls across the model lifecycle, which suits small teams that cannot do everything at once.
A sensible split: use OWASP for the technical threat list, NIST for how you organize ownership and review, and RAND to prioritize. If you need guardrails that map cleanly between them, see our guide to audit-ready LLM guardrails from OWASP to NIST. Healthcare teams have extra obligations, which we cover in HIPAA AI applications.
Perspective
Most of the broken AI apps that reach us were not built carelessly. They were built quickly, and the speed hid the missing pieces. The demo worked, so everyone assumed the rest would follow.
Our view is simple: hardening is engineering, not magic. We pair AI tooling with experienced human engineers because the last mile is where judgment matters most. A model can write a login flow in seconds. A senior engineer notices that the endpoint behind it has no rate limit, the agent has a key it should not hold, and nobody gets alerted when spend triples overnight.
That is why we start with a review and a fixed scope, not a long rewrite. You learn what is solid, what is risky and what to fix first. Then we stay on as long as you need us, because launch day is the beginning of the app’s life, not the end.
Chad
Where to start: a 30-day hardening order
You do not need to do everything at once. This order gives the most protection per hour for a small team.
Week 1: see what you have. List every model, API key, agent tool, data store and dependency. Walk the OWASP list and mark each risk as covered, partly covered or open.
Week 2: close the cheap, dangerous gaps. Move secrets out of code, authenticate every endpoint, add rate limits and spend caps, and cut agent permissions to the minimum.
Week 3: build the gate. Automate deployment, add an evaluation set and adversarial tests, and make the build fail below your threshold.
Week 4: watch and rehearse. Stand up dashboards and alerts, add a kill switch, and run a tabletop exercise: what do we do if the agent starts sending bad emails? Who turns it off?

If your app came from an AI builder or a weekend of prompting, a second pair of eyes saves time at the start. Our guide to production-ready AI code lists what to look for first.
How Bowtie helps harden your app
We publish prices for the pieces of this work, so you can scope it without a sales call. These are our published starting points:
| Service | Price | Fits this step |
|---|---|---|
| ShipDoctor scan | $59 one-off | A quick automated look at an app |
| Vibe Check | $449 one-off | Review of a vibe-coded app |
| Senior Developer Review | from $449 one-off | Human review of your code |
| Infrastructure Assessment | $2,750 one-off | Hosting, environments, secrets |
| Automated Monitoring / Logging / Alerts | $2,750 one-off | Post-launch visibility |
| Dockerizing Your Application | $3,800 one-off | Repeatable deployments |
| Continuous Integration (CI) Assessment | $4,500 one-off | Pipeline and test gates |
| Ship Shape Service | from $1,850 per month | Ongoing support after launch |
Prices are as published on our site and may change, so check the current pricing page before you plan a budget.
Not sure where your app stands?
Start with a review. Our Vibe Check and monthly support plans are built for founders whose AI-built app needs to get across the finish line, and our full price list shows every assessment we offer.

If you prefer to talk through your situation first, see all of our services, including AI code reviews, agent and workflow automation, local AI model development and team augmentation.
FAQ
What is the first thing to fix before launching an AI app?
Start with what an attacker or a bug can reach: unauthenticated endpoints, exposed keys and agents with broad permissions. Then add rate and spend limits so one failure cannot run up a huge bill. After that, work through the OWASP LLM Top 10 to find the gaps specific to language models.
Is production hardening the same as AI red teaming?
No. Red teaming and adversarial testing are one part of it. Hardening also covers deployment automation, access control, staging, rollback, monitoring and incident response. Adversarial tests belong inside your CI pipeline so they run on every change.
Do I need NIST AI RMF to harden my app?
It is voluntary, and NIST says its functions are not a checklist. It is most useful for organizing who owns which risks and how often you review them. For hands-on technical controls, OWASP’s lists and cheat sheets are more specific.
How often should I retest after launch?
NIST says AI systems should be tested regularly during operation, not only before deployment. In practice, run your evaluation and adversarial suites on every change to prompts, models or dependencies, and review monitoring data on a regular schedule your team documents.
Can a vibe-coded app be hardened, or does it need a rewrite?
Often it can be hardened. A review shows which parts are sound and which need rework, so you fix the risky areas first instead of starting over. That is the idea behind our Vibe Check.
Sources
- Hardening the generative AI application through a GenAIOps approach, AWS Prescriptive Guidance
- Artificial Intelligence Risk Management Framework (AI RMF 1.0), NIST
- OWASP Top 10 for LLM Applications 2025
- Secure AI Model Ops, OWASP Cheat Sheet Series
- Principles for the Secure Integration of Artificial Intelligence in Operational Technology, CISA
- AI Risk Assessment for ML Engineers, Microsoft Learn
- A Practical Guide for Securing AI Models, RAND