What AI Does While You Look Away: Guardrails and Harness

An LLM is a probabilistic component. The model will err. The engineering task is ensuring that error stays an error of the model, not a product incident.

An agent sends an email with order details to the wrong recipient. Another generates a destructive SQL query against the production database — because a "delete command example" was sitting in the text of the ticket it was reading. A third pulls a fragment of an internal document through RAG, complete with a secret token, and hands it to the user.

These failure modes show up when agents get write access to email, databases, or internal knowledge bases. In each case, the model produced a syntactically valid action; the system failed to constrain its consequences. Each operated correctly — a valid tool call, a well-formed SQL query, a relevant fragment from the knowledge base. The incident came from missing authorization, validation, or data-leak controls around the model output.

Assume the model will sometimes misread context, follow injected instructions, or choose a harmful tool call. The engineering task is ensuring that error stays an error of the model, not a production incident. When you first connect to an LLM API, it feels like a finished system. It isn't. A production AI deployment needs infrastructure for authorization, validation, logging, evals, rollback, and monitoring, and it rests on two layers: guardrails and harness.

Continue reading “What AI Does While You Look Away: Guardrails and Harness”

How to Build an AI Stakeholder Alignment Machine

Alignment isn’t a conversation, it’s a dispatch algorithm. Here’s how to build a multi-agent system that routes questions, resolves conflicts by seniority, and gives you a counter that hits zero.

Alignment looks like a conversation. It isn't. It's a dispatch algorithm — routing traffic between people until a set of open questions hits zero. Humans have been running this algorithm manually for decades, badly, because there was nobody to hand it to. Now there is.

What follows is a construction of several agents and tools that drive project alignment without you in the loop: it finds holes in the spec, routes questions to people through channels they actually use, processes answers, resolves contradictions by seniority, and stops either at zero open questions or at an escalation to a human. Stakeholders, adjacent teams, contractors — the mechanics don't change.

Continue reading “How to Build an AI Stakeholder Alignment Machine”

The Employment Theater of AI Code Review

3 AM. A senior developer stares at the monitor, eyes red. On screen: a massive diff. The AI generated five hundred lines of code in three seconds. Now our hero is spending half an hour reading every single line — checking brackets, variable names, indentation. In their head: "This is real engineering work."

From the outside — surrealist tragicomedy: the AI spent a moment, the human spent thirty minutes reading the output. Meanwhile, this same developer refused to spend five minutes before running the model to write clear acceptance criteria, boundary conditions, and an automated test that would verify the code in milliseconds.

The pattern is everywhere.

Continue reading “The Employment Theater of AI Code Review”

The core role of people in software development is over

Try getting a development team to consistently write tests before every commit. Not "agree in principle" — actually do it, without reminders. Or document their code. Or have a senior engineer support code three juniors wrote six months ago.

If you've never managed developers, this sounds like a process problem. If you have — you understand why what I'm about to describe doesn't surprise me anymore.


Continue reading “The core role of people in software development is over”

Hide and protect your AWS S3 endpoint (Rails+Nginx example)

It is very simple to use S3 as a storage for your static content in Rails application. Just add paperclip and aws-sdk gems. But what to do if you want to hide the direct links to S3 items, or even restrict access to some files by user’s roles and access rights? Here is a working example: Continue reading “Hide and protect your AWS S3 endpoint (Rails+Nginx example)”

Conditional GET for lists (nice trick)

Here is the nice trick to achieve Conditional GET request for lists (Index operation in classic REST terms). You know about this mechanism for single items (show operation): browser asks a resource for the first time, cache it’s last_modified value, and send “If-Modified-Since” header in the next request. A server checks database for resorce.update_at value, and responds “200 OK” with content as usual (if resource is newer), or responds with “304” without content if resource was not changed.

You can see an economy for computing resources, traffic, parsing and so on. But how to implement this technique for lists? Where is no “updated_at” attribute for the lists…

But don’t give up! Just get a newer resourse in the list, and use it’s “updated_at” attribute.

Here is an example for Ruby on Rails:
updated_at = models.max_by(&:updated_at).try(:updated_at) || Time.at(1)

The last part is a trick for empty lists. Easy!

Caveats: it will not work when you destroy a model from collection by real deleting from the database, because the newer “updated_at” value will not change or even becomes early. Browser will not get actual (changed) content. Use Paranoid gem (or mark it as something like ‘is_deleted’) instead, or switch to ETag.

How to write a code within dataflow paradigm

Of course, you know, there are at least two popular paradigm of programming: imperative and functional. But there is another, very interesting paradigm, which I call as “dataflow”. In this post I want to explain why it is good, and how to use it to build web-related services. Continue reading “How to write a code within dataflow paradigm”

Microservices in a frontend: SOA in JavaScript

In this post we will discuss about the approach to building the frontend of the websites in terms of the microservices paradigm, dataflow and communication between services through the exchange of events (messages). I will use Backbone.js framework as an example.

Why Backbone? Because it is out-of-the-box best (as far as I know) of JavaScript frameworks originally designed to work with the data – instead other frameworks designed to work with visualization layer at the first. If you agree that the models, relationships and business logic – are the core, then you should agree with me. There are other points of view, and other tools – more focused on html, visual effects and the interaction with the user.

This approach is reflected even in the set of Backbone tools: a lot of tools for data and extremely simple templater. Fortunately, you can use the Backbone along with any other templater engine. Continue reading “Microservices in a frontend: SOA in JavaScript”

Queues: web cluster without upstreams orchesration

The story began where I was once asked how to build such HTTP-gate (api endpoint), which proxies requests to a group of lower-level servers (“upstreams”), without any knowledge about their exact IP address, or their quantity, or “health” state. In addition, each request must be processed by the least loaded server in the moment, and the response should be sent synchronously – as plain HTTP response (not as secondary callback).

I do not pretend to be original, but will tell you how we did it: Continue reading “Queues: web cluster without upstreams orchesration”