logoalt Hacker News

Ask HN: How to deal with shipping AI-written code you don't understand?

220 points • by rzk • today at 11:24 AM • 359 comments • view on HN

I saw this LinkedIn post from a Meta engineer and it resonated with me:

https://www.linkedin.com/posts/ali-hamie_im-an-engineer-at-m...

> I'm an engineer at Meta and I never felt this uncomfortable doing my job. I'm writing code these days and it all feels like a black box. This new standard of shipping with AI is moving so fast that if we're going to spend our time checking each line of code, it's going to take forever. That means you can end up with systems you've built where you don't truly understand how all the code works. You understand the high level, but not every detail. And maybe this is becoming the new standard. It goes against every instinct of being a software engineer. I'm used to understanding what I'm building. Now I'm trying to figure out how much I need to understand before I'm comfortable moving forward. Are other engineers feeling this too?

How are you handling this?


Comments

sleepybrett • today at 10:15 PM

if i was working for meta i would be more concerned about my culpability in undermining american democracy.

platevoltage • today at 8:30 PM

I deal with it by not doing it.

ex-aws-dude • today at 4:18 PM

We just don't do that, I don't know why people talk like that is a given

Is it a company culture thing or a domain specific thing?

nkohari • today at 11:10 PM

This was something I personally struggled with for a very long time, so much that we ended up abandoning the product we were working on to build a solution:

https://theseus.dev

Basically, Theseus reads your pull request and your codebase, categorizes the kinds of edits that were made, and writes human-readable documentation that describes what changed. Then, it shows the explanation side-by-side with the code, but presented in a way where you can decide what you want to skim and what you want to deeply review.

I don't think engineers should have to choose between wading through thousands of lines of slop and just smashing LGTM on every pull request. The problem is that the tools for code review are built for an age where code was expensive to write. Now that code is cheap, we need to start experimenting with tools that allow us to stay in sync with what's going on, while also not needing to review every single line individually.

archagon • today at 7:48 PM

Don't.

By doing so, you debase your own profession.

ramesh31 • today at 7:40 PM

You just stop caring. Everyone else did about three months ago. Time to find something new to care about.

petesergeant • today at 7:08 PM

If it's important code (and much isn't), then I spend a lot of time using Matt Pocock's /grilling first, and then I get the agent to kick off peer-review with other agents, and surface any disagreements. Some models are better at it than others. This usually forces me to broadly understand the architecture, and I spend most of my time answering the design questions for which there isn't an obvious solution. I have been pretty happy with the code I've launched to production, as measured by the ways it breaks, and by how agents who weren't part of the original committee describe it.

IAmGraydon • today at 7:07 PM

This is the state that founders and decision makers are usually in at a startup. Sure, sometimes you have the coder founder who wrote the first iteration of the product, but many times the founders have no clue how the product works under the hood. They entrust that to the engineers. That was then. Now, much of that engineering layer has been removed, so the founder just needs a smaller team of people who understand how to structure the software and interact with the LLM. LLMs do the rest.

The problem here is that you're trying to do a job that is already being done for you. Maybe you don't yet trust it to do a good job, but that is quickly changing.

SimianSci • today at 7:25 PM

Anyone who trusts the output of LLMs uncritically, even after the impressive level models and harnesses have gotten to, is borrowing against their future.

Models and harnesses have gotten really good, but they still are hard-capped by the operators that use them. The sycophancy of models is perhaps their greatest weakness, as when a user who might be experienced in one area attempts to use AI to build within an area they are less familiar with, the model does not take a step back and examine the "why" of what is being built from an architectural standpoint, it simply performs the expected task in a direct manner, ultimately creating sloppy work that may be easy to ship but difficult to maintain.

A good example of this was a recent interaction I had with a Dev who was very familiar with how to develop embedded and system level applications. He and every other dev are being asked for increasingly more due to AI, and he had to bring something he had built as a single-user desktop application into a distributed cloud environment. He ended up rsyncing a copy of his working directories including multiple credentials and sensitive internal project documents to a virtual machine binding it to a public ip address. Thankfully our tooling detected this before he could get any farther but it illustrates how the AI model isn't doing any real thinking or engineering at the end of the day. Unless the operator knew to instruct the model about proper cloud architecture and understood best practices around deployment of public systems, the model simply did what it was being told to do by a user who didn't know any better.

Another example of this is the sheer amount of unsophisticated users we've been detecting using Javascript injection into their web browser sessions as a form of automation for web services they may use. These users would never know to ask how to request an API token which may allow them to accomplish things in a much easier and approved way, and instead are relying on the frailest possible automations that expose them to risks of credential exposure.

We've got to be careful with how we engineer things with AI models. Just because we've made boilerplate easier to generate doesn't mean that we can avoid the actual engineering of what we do. And I can't help but think that firms which are fully committed to AI code generation, won't just be introducing an avalanche of slop into their product which will explode the costs of maintenance over time.

gonzalohm • today at 7:57 PM

If you don't understand it, then you haven't built it.

ulfw • today at 2:19 PM

It's Meta. Shipping crap is par for the course. You're fine.

remywang • today at 7:57 PM

Do not

dboreham • today at 7:14 PM

Replace "AI agents" with "a bunch of human coders" and you'll see the answer. Your product needs decent testing and it's your job as the responsible person in charge to make sure that's in place and working properly. So if anything you probably want to be reviewing the test code. But often that isn't necessary since you can do things like introduce bugs deliberately and see if tests fail; check test logs for information that confirms the tests were run as expected; try some manual testing once in a while; ask for new more advanced tests (e.g. test performance not just functionality); and so on.

chrisjj • today at 6:54 PM

> How to deal with shipping AI-written code you don't understand?

Recognise you aren't the one shipping it.

TZubiri • today at 8:55 PM

no one can force you, take responsibility for what you ship, what you choose to ship, how you choose to work, you signed that contract you go to work every day, your company is composed by people like you

don’t wash your hands, or at least don’t expect us to wash them for you

jongha • today at 11:33 PM

[dead]

elianvoss • today at 11:07 PM

[flagged]

melbeesgames • today at 11:03 PM

[flagged]

edwin0 • today at 12:36 PM

The part that makes me uneasy is when the AI writes both the code and the tests. They might agree with each other and still miss the same thing. How are people here checking for that without doing the whole job twice?

➕ show 6 replies
unfazed213 • today at 9:03 PM

[flagged]

Paaul01 • today at 12:56 PM

[flagged]

AmintaCCCP • today at 1:39 PM

[flagged]

fixkitai • today at 2:12 PM

[flagged]

benjy3379 • today at 3:05 PM

[flagged]

tasktoagent • today at 2:02 PM

[flagged]

parsatomosu • today at 4:40 PM

[flagged]

dnurvianto • today at 2:57 PM

[flagged]

tonymet • today at 9:55 PM

[dead]

0x5150 • today at 4:49 PM

[dead]

pluc • today at 11:31 AM

[flagged]

➕ show 4 replies
reaperducer • today at 9:06 PM

Any software engineer shipping A.I. code should stop calling himself an "engineer."

Imagine the carnage if real engineers started vibe-designing bridges.

➕ show 1 reply
lijok • today at 8:31 PM

The people doing this work as a career and not performative art, who were already good at their job, had no worries about this to begin with.

The code was always a black box. Always.

Specs come in, passing tests come out. If you find an issue, your specs were shit.

Anyone that has ever had to outsource work to someone else knows this. If you've ever worked with another team whose codebase you didn't touch - you know this.

You write your specs, you launch an agent to implement them. You launch a 2nd agent to keep the first one honest. When done, you launch as many agents as you have budget to try and poke holes in the implementation. As it always was the case.

You can thrash around (and you will), you can fight it (and you will). Like it or not, the genie is out of the box, and the realization you were never really good at your job to begin with is gonna set in eventually.