TL;DR
An agent-computer interface (ACI) is the layer between a language model agent and the software it works in. It has two parts: the commands the agent is allowed to use, and the format in which the program reports back what happened. Designing that layer well can make an agent much more effective, and it does so without changing the model's weights.
Builds on: LLM Agent, Tool Use · Leads to: SWE-agent
Where it's used
Automated software repair. The SWE-agent paper gives an agent a code repository and asks it to fix a reported bug. The agent searches the code, opens files, edits them and runs tests. The commands it uses for those steps, and the text it reads back after each one, form the ACI. The paper reports that the agent resolved 12.47% of 2,294 real GitHub issues in the SWE-bench test set, using GPT-4 Turbo as the base model.
Browser and desktop agents. An agent that clicks through a web page or a desktop app meets the same design choices. Should it see the raw page structure, or a summary? Should one action click and read the result, or should it take a series of small steps? Each answer is an interface decision.
Customer and internal tools. An agent that looks up orders, reissues refunds or updates records works through an API. A tool that returns every field of a record, when the agent needs two, costs context and makes the next step harder. The same question applies: what does the agent see, and what can it do?
How it works
Trace one small edit from start to finish. This is an illustration, not a measured run. The goal is to change one line in a six-line file. The agent has two possible interfaces, and we compare them.
- The goal and the commands. The agent is told to change line 4 of
config.txtfromdebug = truetodebug = false. In interface A it has only a shell, where it can run any command. In interface B it has anopencommand that shows a window of the file with line numbers, and aneditcommand that takes a start line, an end line and the replacement text. - Interface A, step 1. The agent runs
cat config.txt. The shell prints all six lines with no line numbers. Check: the agent has the text, but it must still work out which line is line 4. - Interface A, step 2. The agent writes a
sedcommand to replace the text. It gets the quoting wrong, and the shell prints an error. Check: one wasted step, and the file has not changed. - Interface A, step 3. The agent tries again with a corrected command. The file changes. The agent runs
catonce more to confirm. Check: four actions in total. - Interface B, step 1. The agent runs
open config.txt. The window shows lines 1 to 6 with numbers, and the total line count. Check: the line number is visible to the agent. - Interface B, step 2. The agent runs
edit 4 4 "debug = false". The program replaces line 4 and immediately shows the updated window. Check: the change and its result are in one step, and the agent does not need a confirmation command.
The model, the task and the goal are the same in both runs. Only the commands and the feedback differ. Interface B used two actions where interface A used four, and the agent could see its own change without asking for it.
flowchart LR M["Language model"] -- "thought and action" --> I["Agent-computer interface"] I -- "command" --> E["Software: files, shell, browser"] E -- "raw output" --> I I -- "formatted observation" --> M
The interface sits in the middle of this loop. It decides which actions exist, how each action is described, how the output is trimmed and labelled, and what happens when an action is malformed. The agent loop is the same for every design; the ACI is what changes.
The math
The loop can be written as a function, in the form of a partially observed decision process with a fixed policy. Let be the history at step , the list of earlier actions and their formatted observations. Let be the action the model picks, and the observation the program returns.
In words: the model's choice depends on the goal , the documentation of the allowed commands , and the history after an optional compression . The observation is the result of applying the action to the environment state , formatted by . The ACI consists of the command set , the documentation , the history policy and the formatter . The model is fixed. The documentation is placed in the prompt, so the model learns the commands from it in context, as in in-context learning.
Step 2 in symbols: a command set
An action set is a list of named commands with their arguments. Interface B has three: open(path), edit(start, end, text) and scroll(direction). Interface A has one, shell(command), whose documentation covers many options. Fewer,
simpler commands make smaller and the documentation shorter, which is the first principle SWE-agent reports.
Step 3 in symbols: the history policy
The history grows by one observation per step. Suppose there are observations, each of about tokens, and the policy keeps the most recent in full and collapses each older one to a line of about tokens. The context size is
The arithmetic is illustrative, not from a paper. With observations of tokens each, keeping all of them in full costs tokens. Keeping the last in full and collapsing the other 15 to tokens each costs tokens. The model sees less old text and still has the plan and the list of past actions.
Step 6 in symbols: the feedback
The formatter decides what the agent sees after an action. If an edit succeeds, a good shows the updated lines. If the edit breaks the code, it shows the error next to the changed lines and discards the edit. Writing this as a rule: the observation should contain the state change that matters and no more.
Worked examples
Two interfaces are used to change one word in a file.
- Interface A needs a
catto read the file, a failedsedbecause of quoting, a correctedsed, and acatto check. That is 4 actions. - Interface B needs an
opento see the file with numbers, and oneeditthat shows the result. That is 2 actions. - Ratio: 2 divided by 4 is one half, so the second interface uses half the actions for this change.
- Interpretation: the commands did not change what the agent could do. They changed how many steps the same change took, and each wasted step adds context and cost.
A search for a function name returns 40 matches across the repository. Two result interfaces are possible.
- Iterative: the agent sees the first match and runs
nextto see each one. Viewing all 40 takes 40 actions, plus the reading between them. - Summarised: the program returns one list of all 40 file names and line numbers, with a note on how to narrow the query. The agent picks the three likely files and opens only those. That is 1 search action plus 3 opens.
- Interpretation: the summarised view takes 4 actions where the iterative view could take 40. The paper reports that agents given a long list of matches tended to inspect every match, which costs budget, so the summary is a design response to that habit. The numbers here are illustrative; the paper compares interfaces with its own measurements.
SWE-agent resolved 286 of 2,294 SWE-bench test tasks, with GPT-4 Turbo as the base model. The paper reports 12.47% for this. A previous best of 3.8% came from a non-interactive, retrieval-augmented system.
- Check the first figure: 286 divided by 2,294 is 0.1247, which is 12.47%.
- Find the number of tasks the previous best solved: 3.8% of 2,294 is about 87.
- Find the difference: 286 minus 87 is about 199 more tasks solved.
- Interpretation: the two systems also differ in more than the interface, so the gap is not all due to the ACI. The paper's own ablations on a 300-task subset are what isolate the interface's contribution.
- Try it: the paper's Lite split has 300 tasks, and the reported resolve rate for SWE-agent on it is 18.00%. How many of the 300 tasks is that? Answer: 0.18 times 300 is 54 tasks.
Common mistakes and tradeoffs
It is tempting to think that a better model makes a better interface unnecessary. In fact a capable model still loses steps to a poor command set, misreads output that is too long, and repeats a search that gave it nothing useful. Interface design and model quality are separate levers, and the paper shows the interface lever working with a fixed model.
It is also tempting to think that more commands always give the agent more power. In fact each command adds documentation to read, choices to make and failure modes to handle. The paper's principle is that simple commands with a few options are easier for agents to use, and that consolidating related steps into one command reduces the number of turns.
A third mistake is to design the interface for a human. A human can scan a long shell output and notice what matters. A
model reads all of it at equal cost, and it can be misled by irrelevant matches. Paths that suit a human, such as a chain
of cd, ls and cat, can be slow for an agent. The paper argues for interfaces built around what the agent needs.
When to invest in an ACI: when the agent works in a software or data environment with many steps, when outputs are long, and when errors can be caught by the program before they reach the agent. When not to: for a single question with one tool call, the interface is too small to matter. Alternatives include simply giving the model a richer prompt or a retrieval step, described in retrieval-augmented generation, which changes what the model knows rather than how it acts. A retrieval step can use a ranking function such as BM25, which is what the paper's non-interactive baseline used.
History
Interfaces for people have been studied for decades in human-computer interaction, where designers measure how easily users complete tasks in a given program. The idea of designing for a non-human user is newer. The SWE-agent paper, posted in May 2024, introduced the term agent-computer interface and showed that changes to commands and feedback improved a language model's performance on software engineering tasks without retraining it. Since then the idea has spread to coding, browsing and desktop agents, although the design of each one remains a matter of experiment.
Recap
- An agent-computer interface is the commands an agent can use plus the format of the feedback it receives.
- The loop of thought, action, observation is the same for every interface; the ACI changes the actions and the feedback.
- Simple commands, consolidated multi-line edits, concise feedback and guardrails such as a syntax check each reduce wasted steps.
- Keeping the recent history in full and compressing older observations keeps the context small.
- Read next: SWE-agent, which applies these principles to repository repair, and ReAct Prompting, which describes the thought and action pattern the agent uses inside the interface.
Check yourself
QuestionIn one sentence, what are the two parts of an agent-computer interface?Show answer
QuestionAn interface needs 4 actions for a task that a redesigned interface does in 2. What is the reduction in actions, as a fraction of the original?Show answer
QuestionA history holds 20 observations of 500 tokens each. The policy keeps the last 5 in full and collapses the other 15 to 20 tokens each. How many tokens does the context take, and why is that useful?Show answer
QuestionWhy would a model that can read a long shell output still do better with a summarised search than with a long raw list?Show answer
QuestionYour team wants a coding agent to edit files more reliably, but the model is fixed. Name one interface change and explain how it would be checked.Show answer
Sources
- Yang, J. et al. (2024). SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering. arXiv:2405.15793. https://arxiv.org/abs/2405.15793
- Human-computer interaction, Wikipedia. https://en.wikipedia.org/wiki/Human%E2%80%93computer_interaction