Skip to main content

3 posts tagged with "agents"

View All Tags

Prompt injection is an input problem, not a prompt problem

· 8 min read

Prompt injection is usually described as a trick played on the model: someone writes "ignore your previous instructions", and the model obeys. That framing leads to the wrong fix. If the problem is a model being fooled, the answer seems to be a better prompt that tells it not to be fooled.

I think the problem is older and more familiar than that. A system takes text it doesn't control, mixes it with its own instructions, and acts on the result. We have seen that shape before, in SQL injection and in cross-site scripting, and in neither case was the fix a politer request to the database or the browser.

Designing tools an LLM can use correctly

· 8 min read

When you give a model a tool, you are publishing an API. The consumer is an unusual one, though. It never reads your source, never opens the documentation site, and never asks a colleague what a parameter means. All it gets is a name, a paragraph of description and a JSON Schema, and from those it has to decide whether to call the tool, when, and with what.

Everything I believe about API design still applies. The difference is that the margin for ambiguity is gone: a developer who misreads a parameter finds out in code review, a model finds out in production, if at all.

What goes in the context window

· 8 min read

Everything a model knows about the current request arrives as one block of input: your instructions, the tool definitions, the documents you retrieved, the conversation so far and whatever the last tool returned. The model has no other memory. If something is not in that block, it does not exist for this call.

Context windows are now large enough that it is tempting to put everything in and let the model sort it out. I think that is the wrong default. The window is a budget, and like any budget it is easier to spend well when you decide what each part is for.