2 camadas · 1 teste decide qual2 layers · 1 test tells them apart

O agente não é só
o modelo.

The agent is not just
the model.

O modelo raciocina. O harness é tudo que ele pode tocar: ferramentas, sandbox, permissão, a forma do erro. O loop é o que acontece entre uma chamada e a próxima — o que dispara, o que verifica, o que faz parar.

Trocar de modelo muda pouco. Trocar essas duas muda o produto.

The model reasons. The harness is everything it can touch: tools, sandbox, permissions, the shape of the error. The loop is what happens between one call and the next — what triggers, what verifies, what makes it stop.

Changing the model moves little. Changing these two changes the product.

2camadaslayers
7sintomas mapeadossymptoms mapped
4degraus de escoposcope rungs
1teste de uma linhaone-line test

as duas camadas

the two layers

O que ele consegue fazer, e o que ele faz.

What it can do, and what it does.

Harness

O que o agente consegue fazer?

What the agent can do

  • As ferramentas que existem — e como estão descritas. Ferramenta mal descrita é capacidade que nunca vai ser usada direito.
  • O sandbox: sistema de arquivos, rede, limite de recurso.
  • Permissão e aprovação — o que roda sozinho, o que espera gente, o que é recusado na hora.
  • O que sobrevive a um reinício, e o que a compactação de contexto pode jogar fora.
  • A forma do erro: uma ferramenta que falhou devolve algo estruturado, ou um stack trace opaco?
  • Which tools exist — and how they are described. A badly described tool is a capability nobody will use correctly.
  • The sandbox: filesystem, network, resource limits.
  • Permissions and approval — what runs alone, what waits for a person, what is refused outright.
  • What survives a restart, and what context compaction may throw away.
  • The shape of the error: does a failed tool return something structured, or an opaque stack trace?

Loop

O que ele faz, e quando para?

What it does, and when it stops

  • O que é uma iteração: planejar, agir, criticar, verificar.
  • O que dispara a próxima — teste vermelho, veredicto, relógio, resposta humana.
  • O critério de pronto. “Está bom” não é critério; “os testes passam e a cobertura não caiu” é.
  • O que fazer quando falha: repetir igual, repetir diferente, voltar atrás ou parar.
  • O teto de iterações e o detector de não-progresso.
  • What one iteration is: plan, act, critique, verify.
  • What triggers the next — a red test, a verdict, a clock, a human reply.
  • The definition of done. “Looks good” is not one; “tests pass and coverage didn't drop” is.
  • What happens on failure: retry the same, retry differently, back out, or stop.
  • The iteration cap and the no-progress detector.
o teste de uma linhathe one-line test

Se dá para consertar mudando um prompt, um critério de parada ou uma regra de repetição, é loop. Se é preciso mudar o que o agente consegue fazer ou enxergar, é harness.

If you can fix it by changing a prompt, a stopping condition or a retry rule, it is the loop. If you have to change what the agent can do or see, it is the harness.

às duas da manhã

at 2 a.m.

Em qual camada está falhando.

Which layer is failing.

Os sintomas se sobrepõem quase por completo. O que separa as duas não é a aparência do defeito — é o que resolve.

The symptoms overlap almost entirely. What separates the two is not how the defect looks — it is what fixes it.

Sintomaé loop se…é harness se…
nunca terminanão há critério de parada, ou há um que ninguém consegue avaliaro sinal que mandaria parar não é observável de dentro
para cedo demaiso critério de pronto está frouxoa verificação não existe, ou falha calada
repete o mesmo erroa nova tentativa é idêntica à anterioro erro volta como texto opaco, sobre o qual não dá para agir
escolhe a ferramenta erradao plano estava ruima descrição engana, ou a ferramenta certa não existe
funciona uma vez, falha na segundao ciclo presume estado limponão há isolamento entre execuções
bom no meu terminal, quebra no CIquase sempre: credencial, sandbox, timeout
queima token sem andariteração sem teto, sem disjuntoro contexto não é compactado e tudo é reenviado a cada turno
Symptomloop, if…harness, if…
never finishesthere is no stopping condition, or one nobody can evaluatethe signal that would say stop is not observable from inside
stops too earlythe definition of done is looseverification is missing, or fails silently
same error, again and againthe retry is identical to the attempt beforethe error comes back as opaque text nobody can act on
picks the wrong toolthe plan was poorthe description misleads, or the right tool does not exist
works once, fails on the second runthe cycle assumes a clean slatethere is no isolation between runs
fine on my terminal, broken in CIalmost always: credentials, sandbox, timeouts
burns tokens without movinguncapped iteration, no circuit breakercontext is never compacted, so everything is resent each turn

O teste da repetição: rode a mesma tarefa duas vezes a partir de um estado limpo. A mesma falha nas duas aponta para o harness — defeito de ambiente é determinístico e se reproduz. Falhas diferentes apontam para o loop, porque o modelo seguiu outro caminho.

The repetition test: run the same task twice from a clean slate. The same failure both times points at the harness — environment defects are deterministic and reproduce. Different failures point at the loop, because the model took another path.

a conta

the bill

Loop dá pico. Harness vira imposto.

A loop spikes. A harness taxes.

O loop mexe na conta diretamente: o gasto é iterações × contexto por iteração, e ele controla os dois. O harness mexe de forma estrutural — uma ferramenta que devolve 40 mil tokens de log cru cobra por todos os turnos seguintes daquela trajetória. Loop ruim dá um pico que se nota. Harness ruim vira imposto que se paga para sempre.

The loop moves the bill directly: spend is iterations × context per iteration, and it controls both. The harness moves it structurally — a tool returning 40,000 tokens of raw log charges you for every remaining turn of that trajectory. A bad loop is a spike you notice. A bad harness is a tax you pay forever.

Medido aqui, em agosto de 2026. Um detector de repetição com teto 3 não disparou em duas rodadas seguidas: o modelo repetiu 2 vezes e, na rodada seguinte, desistiu na . O teste passava e reprovava sem nada mudar no produto — o pior tipo de vermelho, o que ensina a ignorar vermelho. Verificação que depende de o modelo se comportar mal é intermitente por construção; a saída é tornar o teto ajustável e forçá-lo no teste, não pedir com mais ênfase. Gate que nunca reprovou provavelmente não é gate.
Measured here, August 2026. A repetition detector with a threshold of 3 failed to fire on two consecutive runs: the model repeated twice, then gave up on the first try. The test passed and failed with nothing changing in the product — the worst kind of red, the kind that teaches you to ignore red. A check that depends on the model misbehaving is flaky by construction; the fix is to make the cap configurable and force it in the test, not to ask more emphatically. A gate that has never failed is probably not a gate.

prompt · contexto · loop · harness

prompt · context · loop · harness

A escada de escopo.

The scope ladder.

Cada degrau contém o anterior, e cada um apareceu quando o de baixo encostou no teto. Para quem constrói agente hoje, o prompt é o degrau de menor alcance dos quatro — é o mínimo, não a vantagem.

Each rung contains the one below it, and each appeared when the previous hit its ceiling. For anyone building agents today, the prompt has the lowest ceiling of the four — table stakes, not an edge.

na prática

in practice

As duas camadas, construídas e medidas

The two layers, built and measured

Tudo acima é o argumento. O agent-computer é ele de pé: um desktop persistente onde agentes autônomos trabalham, com o harness inteiro — ferramentas, sandbox, cofre, privilégio, observação de kernel por eBPF — e um loop que verifica se a tarefa foi cumprida antes de aceitar que terminou. São sete motivos de parada, e o sétimo existe porque parar não é cumprir.

Everything above is the argument. agent-computer is that argument standing up: a persistent desktop where autonomous agents work, with the whole harness — tools, sandbox, vault, privilege, kernel observation through eBPF — and a loop that checks whether the task was actually fulfilled before accepting that it finished. Seven stop reasons, and the seventh exists because stopping is not fulfilling.

agent-computer — 136 arquivos Go, 608 testes, 90,9% de cobertura com o domínio em 100%. Código aberto sob MIT.

agent-computer.bassi.engineer →  ·  github.com/andrebassi/agent-computer ↗
agent-computer — 136 Go files, 608 tests, 90.9% coverage with the domain at 100%. Open source under MIT.

agent-computer.bassi.engineer →  ·  github.com/andrebassi/agent-computer ↗