What We Set Out to Solve
In 2026, the question most DevOps teams are asking is no longer "should we use AI for operations?" It's "how far do we let it go?" According to Puppet's State of DevOps Report 2023, AI and automation adoption is accelerating across infrastructure teams, but security and governance remain the critical unsolved problems when these tools touch production environments. That tension is exactly what we ran into when we started wiring AI-assisted troubleshooting into our own pipelines.
The original goal was straightforward: use a reasoning model to cut the time engineers spend triaging incidents. Feed it logs, get back a diagnosis, skip the 2 a.m. grep marathon. That part worked. The problem appeared when we started asking what else the system could do if we gave it a little more access.
The honest answer: a lot more. The honest follow-up: that's not always a good thing.
What Happened, Including What Went Wrong
We built the first version of the pipeline with read access to application logs and nothing else. The LLM received structured log excerpts, returned a ranked list of probable causes, and flagged which ones required a human to act. Clean separation. It worked well for about three weeks.
Then someone on the team suggested connecting it to the database query interface, "just for read queries." The reasoning was sensible on its face: if the model could cross-reference slow query logs with actual table statistics, its diagnoses would be more accurate. We tried it in staging. The diagnoses were more accurate.
We did not ship that configuration to production.
Here's why. The moment an automated system has read access to a production database, you've created a path. Not a guaranteed breach, but a path. A reasoning model that can issue SELECT statements can also be prompted, through a malformed log entry or an injected payload, to issue ones you didn't intend. Read-only access is not the same as no-access. It still exposes schema structure, row counts, and data patterns to whatever context window the model is operating in. In a regulated environment, that exposure alone can trigger a compliance finding.
The credential problem is related and more insidious. I've seen build systems that discover credentials by grepping through .env files, shell history, and dotfiles. It sounds like an edge case until you realize how many "temporary" automation scripts start exactly that way. Every credential we use in our n8n pipelines lives in n8n's encrypted credential store, accessed by name through the MCP integration. If a credential is missing, the build stops and waits for manual configuration. The alternative, a build script that discovers and uses whatever keys it can find, is how secrets end up in logs, commits, and crash reports. We never search for API keys in environment variables or filesystem configs during automated runs. The temptation is real, especially under incident pressure. We've resisted it every time.
The pattern we kept running into was this: every expansion of AI access felt locally justified. Each individual permission seemed low-risk. The aggregate picture was not low-risk. By the time you've granted read access to logs, query interfaces, config stores, and deployment manifests, you've given a single compromised prompt the ability to reconstruct most of your production architecture.
This is the gap that Puppet's 2023 report identifies but doesn't fully resolve: teams know governance matters, but the day-to-day pressure to move faster keeps pushing the access boundary outward, one "just for read" exception at a time.
Lessons Learned: A Framework That Actually Holds
After several iterations, we landed on a three-tier access model. It's not novel. What made it stick was writing it down as policy before the next incident, not after.
Tier 1: AI reads exported artifacts, never live systems. The AI pipeline receives log exports, sanitized query plans, and documentation. It never holds a live connection to any production service. This means the analysis is always slightly behind real-time, which is a real tradeoff. For most incident triage, a 60-second lag on log exports is acceptable. For a cascading failure in a payment processor, it may not be. Know which category your systems fall into before you design the pipeline.
Tier 2: Recommendations require human execution. The model produces a ranked action list. A human reviews it, selects an action, and executes it through a separate, audited interface. The AI never writes to production. This creates friction. That friction is the point. The audit trail it generates is also the point, particularly for SOC 2 and ISO 27001 compliance contexts where you need to demonstrate that a human approved every production change.
Tier 3: Escalation gates are explicit, not implicit. If a situation requires the AI to have broader access, that escalation requires a named approver, a time-bounded credential, and a post-incident review. No standing permissions. No "we'll clean this up later" access grants that persist for months.
The tradeoff worth naming directly: this framework slows things down. A fully autonomous system that could read, diagnose, and remediate would resolve some incidents faster. We chose not to build that, because the blast radius of a misconfigured autonomous remediation in production is not a recoverable situation for most teams. Speed is a real value. So is having a database to come back to.
For teams managing sprint-level risk alongside infrastructure risk, the same principle applies to project tooling. Our Jira Sprint Risk Analyzer follows this exact pattern: the pipeline reads Jira data, surfaces risk signals, and presents them to a human for action. It never writes back to Jira autonomously. If you want to understand how we scoped the access boundaries in that build, the setup guide walks through the credential configuration in detail, including why we chose read-only API tokens over OAuth scopes that would permit writes.
One more thing worth stating plainly: this framework assumes your threat model includes the AI system itself as a potential failure point, not just external attackers. A reasoning model that receives a carefully crafted log entry can be induced to recommend actions that serve an attacker's goals. Prompt injection through log data is not theoretical. We wrote about the broader pattern of pre-execution guards in this post on why AI agents need pre-execution checks, and the same logic applies here. The guard isn't just about bad inputs from users. It's about bad inputs from the environment your system is monitoring.
The teams getting this right in 2026 are the ones who treat AI access as a surface area to minimize, not a capability to maximize. Every permission you don't grant is an incident you don't have to explain.
What We'd Do Differently
Write the access policy before the first prototype, not after the first near-miss. We drafted ours reactively, after we'd already built the staging database integration and had to argue for removing it. Drafting it first would have saved two weeks of re-architecture and one uncomfortable conversation with the security team.
Treat log sanitization as a first-class engineering task, not a cleanup step. We initially passed raw logs to the reasoning model and stripped sensitive fields afterward. The correct order is the reverse: sanitize before the data leaves your environment, then pass the cleaned artifact. Sanitizing after means the raw data touched the model's context window, which may be logged, cached, or retained depending on your API configuration. We now run a dedicated sanitization node in every pipeline before any external API call.
Build the human approval step as a product, not a workaround. Our first approval interface was a Slack message with two buttons. It worked, but it created no audit trail and no way to review decisions after the fact. The version we use now writes every approval to a structured log with the approver's identity, the timestamp, and the specific action approved. That log has already been useful in two post-incident reviews. If you're building what ForgeWorkflows calls agentic logic into your operations stack, the approval interface deserves as much design attention as the AI component itself.
Top comments (0)