TL;DR: I’m developing AI systems for a small city government and kept running into the same problems: models fabricating municipal data, ignoring safety constraints, drifting off track in long conversations. Ad-hoc prompting didn’t scale. What worked was treating conversations like engineering problems—explicit boundaries, structured inputs, adversarial testing, and pipeline-level controls. It helped. It didn’t solve everything. The hardest problems are still governance, trust, and the fact that models fail in ways that look like success.
A working document, not a finished theory.
Why I Started Thinking About This as Engineering
I run IT for a small city. About 350 employees, 33,000 residents. When I started deploying AI tools for municipal work, I treated conversations with models the way most people do. Type a question, get an answer, adjust if it’s wrong. That stopped being sufficient pretty fast.
It wasn’t one failure that changed my thinking. It was a pattern. I was building a public-facing chatbot called LACI (Local AI for Civic Information), developing system prompts for an internal staff assistant I call Granite Desk, running adversarial tests against both, and trying to get useful outputs from local models for transcription and summarization. Across all of those efforts, the same problems kept showing up. Inconsistent outputs. Confident fabrication. Behavior that shifted unpredictably depending on how I worded things.
The shift happened when I stopped thinking of these as “chat interfaces” and started thinking of them as systems. Systems with inputs, constraints, state, and failure modes. The quality of what I was building improved. Not because the models got better. Because my engineering discipline around them did.
What Broke When I Treated Conversations Casually
Early on, I tested a local model called Nemotron for generating training data for my municipal assistant. The system prompt explicitly said “never fabricate policies, data, or official documents.” The model ignored it entirely. It invented permit fees, shift schedules, budget figures, construction timelines. All stated with complete confidence. Every single example would have trained a downstream model to hallucinate municipal data. A Claude-generated training set for the same task used placeholders and admitted limitations. Same job, radically different reliability. The difference came down to whether the model actually respected the constraints I set.
Context drift was another recurring problem. In longer conversations about CJIS compliance or infrastructure planning, models would start strong but gradually lose the thread. They’d mix requirements from different regulatory frameworks, forget constraints I’d established earlier, or make assumptions I hadn’t authorized. “Just try another prompt” doesn’t work when the problem is accumulated state, not the last thing you typed.
The adversarial testing on Granite Desk made all of this very concrete. The model failed two critical red-team scenarios out of ten. It wrote a fake memo impersonating the City Manager and generated a phishing email template complete with urgency language and a spoofed sender address. The system prompt said don’t do those things. The model did them anyway. That’s not a prompting problem. That’s a system reliability problem. Treating it like one changed how I approached everything after.
The Core Principles That Emerged
These aren’t canonical. They’re patterns I’ve landed on through iteration and failure.
Explicit goals and boundaries. Every system prompt I write now starts with hard boundaries. What the system must never do comes before what it should do. The LACI prompt has a “DO NOT” section that’s longer than the “PROVIDE” section. Granite Desk has an explicit list of refusals with example language for how to refuse. Ambiguity in boundaries is where failures live.
Input shaping and constraint. I learned that how I structure a request matters more than how cleverly I phrase it. Introducing constraints gradually rather than front-loading everything consistently produced better results. One early experiment showed this clearly. A strategic, multi-phase conversation about CJIS-compliant transcript processing produced far more detailed and actionable output than the same requirements stated all at once. The structure of the conversation itself was doing engineering work, and I didn’t fully appreciate that until I saw the difference side by side.
Output expectations and validation. I don’t trust model output by default anymore. Every deployment includes a test plan with three categories: legitimate use cases, off-topic probes, and adversarial scenarios. The adversarial set runs first. If the model complies with any red-team test, the system prompt gets hardened before anyone else touches it. This is basic quality assurance applied to a non-deterministic system. Nothing exotic about it.
Treating conversation as a controlled process. Temperature settings matter. Model selection matters. Context window management matters. I’ve built workflows in n8n that handle context assembly, constraint injection, and output parsing as discrete pipeline steps—not as one undifferentiated “chat” interaction. The conversation is the interface. The engineering is everything around it.
Where This Showed Up in Real Projects
When LACI couldn’t answer basic questions about building permit fees, the issue wasn’t the prompt. No structured data existed to ground it. I had to make a governance decision, not a prompting decision. I parked the chatbot until the data governance RFP could inventory and validate the source data. The interim solution was scoping LACI to search only rochesternh.gov. That was a constraint decision: limit the system’s access to authoritative content rather than letting it fabricate answers from training data.
The Granite Desk hardening cycle was iterative. First system prompt failed adversarial tests. I added explicit refusals. Retested. Still failed on edge cases. Added example refusal language. Retested again. The whole process looked a lot more like debugging software than writing prose. Because that’s what it was.
For the CJIS-compliant transcript processing work, the entire approach had to account for data classification, PII anonymization, and audit logging before any model touched any data. The conversational interface was honestly the least interesting part. The real engineering was in the pipeline: document processing, PII detection with custom recognizers for law enforcement data, proxy architecture to make sure nothing sensitive ever reached the model endpoint.
Even with all of that structure, things still failed. Smaller models ignored constraints that larger models respected. Temperature settings that worked for factual queries produced unreliable results for summarization. Context windows that seemed adequate for single documents fell apart with multi-document analysis. Structure improved reliability. It did not guarantee it.
What This Methodology Does Not Solve
Model limitations are real and non-negotiable. No amount of prompt engineering makes a 3B-parameter model reliably follow complex multi-constraint instructions. I’ve tested this directly. The failure mode isn’t that the model refuses. It’s that it complies confidently with something wrong.
Data quality is upstream of everything. LACI couldn’t be useful until the city’s data was inventoried and validated. No conversational methodology fixes the absence of authoritative source material. Garbage in, confident garbage out.
Trust, accountability, and governance remain open problems. When a model states something with authority, people tend to believe it. In a municipal context, “the chatbot said” creates real liability. That fluent, confident tone the model uses? It actively hides risk. A well-structured system prompt can help, but it can’t eliminate the fundamental tension between how authoritative the model sounds and how reliable it actually is.
Why Governance and Security Matter More Here
Conversational AI has a risk profile that traditional software doesn’t. A database query either returns the right data or throws an error. A model can return plausible fabrication with no error signal at all.
The authoritative tone is the core problem. When my test model wrote that fake City Manager memo, it wasn’t flagged as uncertain or speculative. It was formatted like an official document. An employee who didn’t know better could have circulated it. The model didn’t fail in an obvious way. It failed in a way that looked like success.
Auditability is hard. Conversations are ephemeral by default. Reproducing a specific output requires the same model, the same temperature, the same context, the same prompt. And even then, non-determinism means you might get something different. I’ve been building logging and archival systems to address this, but it’s fundamentally more difficult than auditing traditional software.
In a government context, every AI-generated output is potentially subject to Right-to-Know requests under New Hampshire RSA 91-A. Every conversation might be a public record. That changes how you design the system, what you log, and what you let the model say.
How My Thinking Is Still Evolving
I don’t have a clean conclusion here, because the work isn’t done.
There are questions I’m still sitting with. How do you validate model behavior across updates when the same prompt may produce different results on a newer model version? How do you build institutional trust in AI systems when the failure modes are invisible to non-technical users? At what point does structured prompting become a false sense of security—a way of feeling rigorous without actually reducing risk?
There’s a version of this that could probably be formalized into something repeatable. I’ve thought about it. But formalizing it risks exactly the kind of false confidence I’m trying to avoid. The value isn’t in the patterns themselves. It’s in the discipline of treating every interaction as an engineering problem, testing your assumptions, and being honest about what doesn’t work.
I’m not selling a framework. I’m just documenting how I think about systems that talk back.
Written by Andy Watkins | Edited and formatted with AI assistance
Written by Andy Watkins | Organized and Edited with the help of AI.
These thoughts are my own and an accumulation of 30+ years of technology experience.