What Actually Costs You in a Production DevOps System
The costly part of production isn’t your code. Explore five areas of hidden DevOps debt: identity, supply chain, guardrails, observability, and CI/CD.
The service you set out to build is rarely what ends up costing you. The expensive part is everything wrapped around it.
After eleven years of building and running infrastructure, I keep relearning the same lesson. A service's business logic might be a few thousand lines. Getting it into production safely takes far more engineering: deciding who can deploy it, trusting what it's built from, enforcing rules on what it's allowed to do, knowing when it's broken, and shipping changes without breaking it further. None of that shows up on the original project plan, and all of it accumulates debt.
Below are the five areas where that debt has cost me the most, each with a concrete example of how it surfaced and what fixed it.
1. Identity: The Trust Policy Nobody Reviews
A pipeline's ability to deploy, a service's ability to call another service, and an engineer's ability to touch production all come down to the same question: who is allowed to do what? IAM roles, Kubernetes RBAC bindings, and OIDC trust relationships between CI runners and cloud accounts are easy to get working and hard to get right. Broad roles get granted under deadline pressure and rarely get revisited. A GitHub Actions workflow holding a long-lived AWS access key quietly becomes one of the most valuable targets in the organization.
Most teams eventually move to OIDC federation. The pipeline presents a short-lived signed token, and the cloud provider checks its claims against a trust policy before issuing temporary credentials.

Removing the stored secret is only half the job. The trust policy is where the real access decision lives, and the most common mistake I see is a wildcard in the sub condition that lets any branch, or any repo in the organization, assume a production role. This is the shape I use instead:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::111122223333:oidc-provider/token.actions.githubusercontent.com"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
"token.actions.githubusercontent.com:sub": "repo:my-org/payments-service:environment:production"
}
}
}]
}
Scoping sub to a GitHub environment rather than repo:my-org/* means only a job that passed that environment's protection rules (required reviewers, branch restrictions) can assume the role.
The same thinking applies inside the cluster. For an EKS incident-diagnosis agent I work on, the Terraform module grants the IRSA role permission to call Bedrock only when the agent runs in a mode that uses Bedrock, and the diagnostic tools get read-only RBAC. That one decision separates an agent that can look at a cluster from one that can change it.
2. Supply Chain: Pinning Is Harder Than It Looks
Every deployment depends on base images, packages, and build artifacts you didn't write. SBOMs, artifact signing with cosign, and SLSA provenance exist because pulling dependencies without verifying them is how supply-chain attacks get in. A pipeline that uses latest tags, has no lockfile, or trusts unsigned images is carrying risk nobody sees until a compromised package ships.
I learned how leaky "we pin our dependencies" can be when I switched a Python project to pip install --require-hashes. One package was installed from a git URL that pointed at a branch. Pip refuses to hash-verify version-control dependencies, so the install failed outright. The obvious workaround, dropping hash mode for that one package, would have left a dependency that changed whenever someone pushed to that branch.
The fix was to pin the dependency to an exact commit and keep everything else hash-locked:
# requirements.in
# Before: tracks a moving branch
# internal-tools @ git+https://github.com/my-org/internal-tools@main
# After: immutable commit
internal-tools @ git+https://github.com/my-org/internal-tools@3f9c2a1e8b7d4c6f0a2e5b9d1c8f7a6e4b3d2c1f
# Lock everything else with hashes
$ pip-compile --generate-hashes requirements.in
Then I rebuilt the environment from scratch in a clean virtualenv before trusting the lockfile. A commit SHA isn't a cryptographic hash of the package contents, but it can't be moved by a force-push, and that closed the actual gap.
3. Guardrails: Enforced vs. Believed to Be Enforced
Policy-as-code tools like OPA and Kyverno can block a root container, a security group open to 0.0.0.0/0, or a Terraform plan that touches a production database without approval. The debt I run into most often is the gap between what a team believes is enforced and what is. A rule that lives on a wiki page and a review checklist will eventually be skipped by a tired engineer on a Friday.
The same problem shows up with AI agents. I built a five-layer guardrail pipeline for agentic workflows on AWS Bedrock: input validation, adversarial-prompt detection, tool-call authorization, output calibration, and a human-approval gate. I later moved those checks onto Strands Agent hooks so they run at each step of the agent's tool-calling loop, not just on the first input and the final output.
Two things from that work are worth sharing. First, guardrails cost latency, and the naive version was slow. My first implementation took 13,874 ms end to end. After reworking how the layers ran, it took 1,828 ms, about 7.6x faster. I only found that gap because I measured both versions instead of assuming the extra checks were cheap. Second, passing a test suite is not the same as being proven in production. The hook-based version passes its full test suite, including interrupt-and-resume cycles for the approval gate, but it hasn't handled live production traffic yet. Writing that limitation down is part of managing the debt.
4. Observability: Tools That Report the Wrong Thing
OpenTelemetry has made it far easier to collect traces, metrics, and logs. The harder problem is whether the data answers the question you have during an incident. Metrics without correlated traces, logs without consistent fields, and dashboards built for an architecture that's since changed all look like visibility until you need them.
The failure I worry about most is a tool that confidently reports something false, and I've shipped two of them.
The first was in the EKS diagnostic tooling. When I ran its root-cause report against its own output, I found that the overall severity field could say "OK" even when most of the diagnostic sections had failed. A shadowed import was also breaking error handling partway through the report, so failures were being swallowed instead of surfaced. Both bugs had passed earlier testing.
The second came from evaluating the guardrail pipeline. My first results file looked complete, but every entry turned out to be a Bedrock ThrottlingException. The evaluation had measured rate limiting, not the guardrails. I rebuilt the Bedrock setup and reran the full evaluation, comparing a single-layer baseline against the five-layer configuration before trusting any numbers.
Both bugs taught me the same rule: before an observability or evaluation tool is allowed to report success, test that it can report failure. Give it a broken input on purpose and confirm the summary says so.
5. CI/CD: A Distributed System, Not a Script
A deployment pipeline is a stateful, multi-step workflow with failure modes at every stage, yet it's often built like a shell script that assumes each step succeeds. The questions that matter are rarely asked upfront. Which steps should be automatic, and which need a human? If a deploy fails halfway, is the environment left half-applied, or can the pipeline roll back cleanly? Which steps retry, how many times, and when does the pipeline stop retrying and page someone?
Rollback decisions deserve the most care. A canary is only as good as its health check. "The canary looked unhealthy" should be the result of a defined calculation over error rate, latency, and saturation that anyone can rerun, not a judgment call by whoever is on call. If a canary check has never caught a deliberately bad deploy in a test, it isn't protecting you yet.
On a recent multi-repo agent project, this meant two unglamorous workflows. The application repo installs dependencies from the hash-locked file, runs the tests, and builds the container image. The Terraform module's repo runs terraform fmt -check and terraform validate against the root module and every example. Neither took long to write. Both exist so that a broken lockfile or invalid module gets caught in a pull request instead of during a deployment.
What I'd Do First
Cost controls, service catalogs, and runtime choices create debt too, but these five are where I've seen the most expensive surprises. If you're inheriting a system and can only check a few things this week:
- Search your OIDC trust policies for wildcards in the
subcondition. - Find every dependency that installs from a branch or a
latesttag. - Pick one policy your team says is enforced and try to violate it in a test environment.
- Feed your incident or health-check tooling a known failure and confirm it reports one.
- Check whether a failed deploy can actually roll back, and when that was last tested.
Every item on that list came from a real failure. In each case, the application code was fine. The problem was in the system around it.
Opinions expressed by DZone contributors are their own.