Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path →
Turn the demo into
something they trust.
A demo runs once, on a good day, with you watching. Production runs thousands of times against systems that fail intermittently, with no one watching but the customer. The gap between the two is where a lot of otherwise-successful deployments quietly die. Hardening is how you cross it — deliberately.
The gap nobody demos
Here’s the trap that catches good engineers: the demo went great, the customer is excited, so it must be nearly done. It isn’t. A demo is a single run of the happy path under ideal conditions with you standing by. Production is thousands of runs, including every unhappy path, against systems that fail on their own schedule, with no one watching. The distance between those two is enormous, and it’s invisible from the demo.
Naming that gap is the first act of hardening. A prototype optimized for the demo has, by design, none of the machinery needed to survive real traffic — and that’s fine, until the moment a real user depends on it. Hardening is the deliberate work of building that machinery, and treating it as a real project (not a weekend of cleanup) is what separates deployments that last from ones that flame out three weeks after the applause.
Reliability: assume everything fails
Production is a hostile environment. A handful of patterns turns a fragile demo into a system that shrugs off the failures a demo never sees.
Every external call can time out, rate-limit, error, or silently double-deliver. Design as if it will. These patterns — each with a hands-on challenge in the track — are the core of reliability.
None of this is exotic, and you don’t need all of it everywhere — you need it on the paths that touch the real world. If you internalize one thing, make it idempotency: it’s the pattern that makes every retry safe, and retries are how a distributed system survives a flaky one.
Observability: know before they tell you
The demo has perfect observability — you’re watching it live. Production has none unless you build it, and on a locked-down deployment you may never see the running system at all. So you instrument it to report on itself.
The minimum
- Structured logs with a request/correlation id — trace one operation end to end.
- Metrics + alerts on the one number that means “it’s working”; alert when it moves.
- A real health check — readiness/liveness, not just “the process is up.”
The goal
- Learn it broke before the customer tells you.
- Diagnose a failure without shell access to the box.
- Wire alerts into their channel too, so the right people know.
The bar to clear is simple and unforgiving: could you diagnose a 2 a.m. failure without touching the machine? If the answer is no, you don’t have enough observability yet — and on a deployment where you can’t reach the system, that gap is the difference between a five-minute fix and a lost account.
Security and config hygiene
Demos cut corners that production can’t afford: a key in the code, a value hardcoded to one customer, a deploy you did by hand and couldn’t repeat. Hardening closes them.
| Demo shortcut | Production requirement |
|---|---|
| Secret in the code or a .env in the repo | Secrets in a vault/KMS + env injection; nothing in logs |
| A broad admin credential | Least-privilege access scoped to what the job needs |
| Values hardcoded to one customer | Per-environment config; nothing baked to a single tenant |
| A hand-run deploy | One command / pipeline to deploy and roll back — no snowflake servers |
The last row is the sleeper. A deployment you can’t reliably reproduce or roll back is a deployment that will eventually strand you — a bad release with no way back, on a system you may not even be able to reach. A repeatable, reversible deploy isn’t polish; it’s the safety net the whole engagement rests on. (The full gate is the POC → production checklist.)
Harden, or rebuild?
Before you harden, ask whether you should. A prototype was built to be disposable, and its speed came from shortcuts. If those shortcuts are localized — a hardcoded config here, a stub there — hardening in place is efficient. If they’re woven through everything — no error handling anywhere, state smeared across globals, a structure that fought you even in the demo — a clean rebuild informed by everything you learned is often faster and always cleaner.
Engineers over-attach to code they’ve written. Ask: “If I were starting today, knowing what I now know, would I build it this way?” If the answer is a clear no, rebuild. The prototype already did its job — it taught you the answer.
Hardening ends in handoff
A hardened system isn’t the finish line — a system the customer’s team can run without you is. So the last act of hardening points at the handoff: the reliability, observability, and repeatable deploys you just built are exactly what make it operable by someone else. Pair them with a runbook (how to deploy, roll back, rotate secrets, and fix the top few failures) and documentation their engineers can actually use, and you’ve turned a demo into an asset they own.
This is the difference between an FDE who ships and one who becomes a permanent, unpaid support team for everything they ever built. Harden it so it survives, then hand it off so it thrives — the checklist covers both, and the discipline of building for handoff from the start is what keeps you free to go solve the next customer’s problem.
The hardening gate, written as assertions
“Production-ready” is a conversation until it is a list someone can fail. Here is the list, in the order things actually break.
The gap between a working proof of concept and something a customer’s team depends on is not mostly code — it is the set of failure modes the POC was allowed to ignore. Writing them as assertions rather than as a document does two things: it makes the gate refusable, and it turns “is this ready?” from a judgement call into a check anyone can run.
Happy path only
The POC handled the cases you chose. Production meets the malformed PDF, the empty file, the 14MB attachment and the record from 2011.
You in the loop
The POC worked because you were watching. Production runs at 02:00 while their operator reads a runbook you have not written.
One data source
The POC read the clean export. Production reads the live system, which is being written to while you read it.
correctness
assert eval.overall >= human_baseline # measured, not claimed
assert eval.high_cost_error_rate <= budget
assert eval.regressions == [] # the one that earns its keep
failure
assert handles(malformed_input, empty_input, oversized_input)
assert upstream_down_returns_a_message_not_a_timeout()
assert every_write_is_idempotent() # retries WILL happen
assert rollback_tested_in_their_environment()
operability
assert health_endpoint_names_the_failing_dependency()
assert errors_say_what_to_do_not_just_what_happened()
assert runbook_covers(last_five_incidents, symptom_first=True)
assert logs_redaction_safe_and_exportable_by_them()
identity & evidence
assert no_static_credentials_in_config()
assert deactivating_a_user_revokes_sessions_and_tokens()
assert audit_log_reconstructs_a_decision_six_months_later()
ownership
assert their_engineer_has_deployed_it_once, "with you watching"
assert named_owner_for(state, change_approval, first_response)
The assertion people argue about is the last one, and it is the one that decides whether this is a deployment or a dependency. An engineer of theirs who has deployed the system once, with their credentials, through their pipeline, while you watched, has surfaced every piece of undocumented knowledge you still hold — and that hour is worth more than the document you would otherwise have written instead.
source system returned 403 — check the service-account credential expiry converts a 2am page into a self-service fix, permanently, for a team that is not you. It is worth more than any dashboard, and it costs one string. Every incident you handle should add one of these and one runbook entry — see incidents, on-call & SLAs.
Worked example: why the demo lied, in numbers
Say each run of a workflow makes 3 external calls, and each call fails 1% of the time (a timeout, a 503, a rate limit), independently. The demo runs once. Production runs 2,000 times a day. Suppose one in five failures is a timeout where the write actually landed and only the response was lost. All of these rates are illustrative.
| Step | Question | Arithmetic | Answer |
|---|---|---|---|
| 1 | Chance the demo run is clean | 0.99 × 0.99 × 0.99 | 97.0%: the demo almost always works |
| 2 | Failed runs a day, no retries | 2,000 × (1 − 0.970) | 59.4 a day |
| 3 | Add 2 retries per call | a call fails only if all 3 tries fail: 0.01³ = 0.000001 | about 0.006 failed runs a day, one every ~167 days |
| 4 | Failed calls a day | 2,000 × 3 × 1% | 60 |
| 5 | Of those, writes that landed anyway | 60 ÷ 5 | 12 a day |
| 6 | Duplicates from retrying them, no idempotency | 12 × 30 days | 360 double-writes a month |
| 7 | Same retries with an idempotency key | the second write finds the key and returns the first result | 0 duplicates |
| 8 | The upstream is down for 30 minutes | 2,000 ÷ 1,440 min × 30 | about 42 runs fail whatever you retry |
Steps 1 and 2 are the gap the page names: a 97% clean demo turns into about 60 failures a day. Step 3 shows that retries alone fix almost all of them, if failures are independent. Step 6 is the price of retries without idempotency: the fix for step 2 quietly creates a new bug that is worse, because a duplicate charge looks like success. Step 8 is why independence is optimistic. Real outages are correlated, retries a few seconds apart all fail together, and only a dead-letter queue you can replay after recovery saves those runs. The idempotency key from step 7 is what makes that replay safe.
Cost and trade-offs of each hardening step
Here Time is the effort to add it. Space is what it costs while running, or what it buys.
| Case | Time | Space | Why |
|---|---|---|---|
| Timeouts on every call | A parameter per client | Turns a hang into an error you can handle | Without one, a stuck upstream holds a worker forever. The rest of the list assumes calls end. |
| Retries with backoff and jitter | A wrapper or library setting | Extra latency on failed calls; extra load on a struggling upstream | Fixes independent failures (step 3). Unsafe without idempotency. |
| Idempotency keys | A key per operation plus a lookup table | One stored key per write, kept for the retry window | Makes every retry, redelivery and replay safe (step 7). |
| Dead-letter queue | A queue and a replay command | Storage for failed work | Catches the correlated outage in step 8 instead of dropping it. |
| Structured logs + correlation id | Pass one id through every call | Log volume, and a redaction pass | Lets someone trace one bad run end to end without shell access. |
| Secrets in a vault, least privilege | Moving config, rotating keys | Little at run time | Limits what a leaked credential can do. |
| One-command deploy and rollback | A pipeline, tested once in their environment | Little at run time | Turns a bad release into a revert, not an incident. |
| Harden in place vs rebuild | Low if shortcuts are local; high if they are everywhere | Rebuild loses the demo’s code, not its lessons | Decide on the honest default in section 05, not on attachment. |
The first three rows are ordered on purpose. Timeouts make failures visible, retries absorb them, and idempotency makes the retries safe. Adding retries before idempotency is how step 6 happens.
Common mistakes
- Retrying writes with no idempotency
A timeout does not mean the write failed. It means you do not know. Retrying without a dedupe key turns lost responses into duplicate charges, emails or rows (step 6 above). Send an idempotency key the upstream honours, or dedupe on your side before writing.
- Retrying errors that will never succeed
A 400, 401, 403 or validation error fails the same way every time. Retrying it wastes the budget and hides the real problem. Retry timeouts, 429 and 5xx, honour
Retry-After, and send everything else straight to a dead-letter queue with the error attached. - No timeout at all
Many HTTP clients wait forever by default (Python’s
requestshas no timeout unless you pass one). One hung upstream then holds every worker that calls it, and the service stops with no error in any log. Set connect and read timeouts on every outbound call. - Retrying in lockstep
Fixed delays mean every client that failed at the same moment retries at the same moment, and hits the recovering upstream as one wave. Use exponential backoff with random jitter so retries spread out.
- Stacked retry layers
Your code retries 3 times, the SDK under it retries 3 times, and the queue redelivers 3 times: one failing call becomes 27 attempts. Pick one layer to own retries and turn the others off, or at least count them.
Check yourself
A webhook sender retries if you do not return 2xx within a few seconds, and your handler sometimes takes longer. What do you build?
Acknowledge fast and work later. Store the event, keyed by the sender’s event id, return 2xx at once, and process it from a queue. The id makes a redelivered event a no-op. Doing the work inside the request means slow runs get redelivered and processed twice.
The upstream has been down for 20 minutes. Retries back off 1 s, 2 s, then 4 s. What happens to runs in that window, and what should catch them?
Every run exhausts its retries in about 7 seconds and fails, because the failures are correlated, not independent. A dead-letter queue should catch them with their inputs, so someone can replay them once the upstream is back. Idempotency keys make that replay safe even if some calls had half-succeeded.
Prototype A has its customer’s config hardcoded in three files. Prototype B keeps state in globals and has no error handling anywhere. Harden or rebuild?
Harden A: its shortcuts are local, so moving three values into per-environment config is a short job. Rebuild B: its shortcuts run through everything, so adding error handling means touching every path while the global state fights you. That is the page’s localized versus woven-through test.
The customer says a run last Tuesday produced the wrong output. You cannot reach their system. What should already exist?
A correlation id on that run, structured logs they can export and send you, and an audit record of the inputs and decision. With those you can trace the one run end to end. Without them you are guessing, which is the page’s 2 a.m. test failed in daylight.
Quick answers
What does it mean to harden a proof of concept?
Hardening turns a demo into a system people can depend on: adding reliability (handling failures, retries, idempotency, validation), observability (structured logs, metrics, alerts, health checks), and security and config hygiene (secrets out of code, least privilege, repeatable deploys). A POC proves the value; hardening makes it survive real traffic against systems that fail — which a demo never has to.
Why do proofs of concept fail in production?
Because a demo only ever runs the happy path once, while production hits every sad path repeatedly: an external call times out, a webhook is delivered twice, a bad record arrives, the customer’s API rate-limits you. A POC built for the demo has none of the retries, idempotency, validation, or monitoring needed to survive that — so it works beautifully until real traffic hits, then fails quietly.
What observability does a deployed system need?
At minimum: structured logs with a request/correlation id so you can trace an operation end to end, metrics on the one number that means "it’s working" plus alerts when it moves, and a real health check. On a locked-down deployment where you can’t reach the system, this is doubly important — it’s how you learn it broke before the customer tells you.
Should you harden the prototype or rebuild it?
Harden it when the core is genuinely sound and its shortcuts are localized; rebuild when the prototype’s hardcoding and hacks are woven throughout, because untangling them is often slower than a clean rebuild informed by everything you learned. Treat it as a deliberate decision, not a default — and remember that a prototype was built to be disposable, so rebuilding is often the honest, faster path.
Explore the topic
See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.
More Handbooks
- The Agent Evaluations HandbookA self-contained handbook on evaluating AI agents — theory, interactive widgets, and practical guidance. Trajectory evals, tool-use scoring, LLM-as-judge, observability, and reliability for PMs, engineers, and founders.Read →
- The Agent Patterns HandbookThe design patterns behind every LLM agent — the ReAct Thought–Action–Observation loop, tool/function calling, plan-and-execute, reflection, memory, multi-agent orchestration, and the failure modes (loops, hallucinated tools, recovery, human-in-the-loop) that break agents in production.Read →
- The Kubernetes HandbookThe one idea under all the YAML — declare desired state, and a control loop makes reality match. Covers the orchestration problem, pods, deployments and replicasets, services and networking, the reconciliation loop and self-healing, the scheduler, config/secrets and health probes, autoscaling, and when you actually need Kubernetes.Read →
- The Observability HandbookSeeing inside production — monitoring vs observability, the three pillars (metrics, logs, traces) and what each answers, structured logging, metric types and the cardinality trap, distributed tracing, the golden signals and SLIs/SLOs/error budgets, alerting on symptoms not causes, and correlating all three during an incident.Read →
- The AI Security HandbookYour app now reads the internet and believes it. Why prompt injection is a design problem filters cannot solve, the lethal trifecta (private data + untrusted content + exfiltration), defense in depth from least privilege to output validation, where PII actually leaks (logs, embeddings, weights), MCP/model supply-chain trust, and the red-team eval suite that gates CI.Read →
- The Docker HandbookA container is a lie told by the kernel — namespaces (what a process sees) plus cgroups (what it uses), not a VM. Image layers and the cache-ordering rule that halves build times, multi-stage Dockerfiles that ship small, volumes vs bind mounts, name-based networking, Compose, and the handoff to Kubernetes.Read →