Can you teach an AI agent a task by showing it once?
Yes, but with caveats. Recording a task gives an agent a concrete sequence to replay, which is more reliable than a vague description. The catch is that recordings are brittle: rename a field, move a button, or change an API response shape and the agent loses its footing. Understanding both the power and the limits saves a lot of frustration later.
What is the difference between recording a task and describing one?
When you describe a task in plain language — 'fetch the latest invoice, extract the total, and post it to the accounting sheet' — the agent has to infer every intermediate step. That inference draws on general reasoning, which is flexible but occasionally wrong in ways that are hard to predict.
Recording a task means the agent observes a real execution: the exact field you clicked, the exact value you typed, the exact endpoint that responded. The resulting instruction set is far more specific. Specificity helps when the environment is stable. It becomes a liability the moment the environment changes, because the agent has no general model to fall back on — it only knows what it saw.
| Situation | Recording | Description |
|---|---|---|
| Stable, unchanging interface | Reliable | Slightly less precise |
| Interface updated by a third party | Breaks silently | Adapts with guidance |
| Task involves judgement or context | Poor fit | Natural fit |
| Task is purely mechanical and repetitive | Excellent fit | Overkill |
| You need to share the task with a colleague | Portable if named well | Easier to read and audit |
Why does a recorded step have to be matched by name rather than position?
Position-based matching means the agent finds a field by where it sits on the screen or in a data structure: 'the third column', 'the second input in the form'. This works until a developer adds a column, reorders a form, or a responsive layout shifts elements on a smaller viewport. The agent then acts on the wrong field with complete confidence.
Name-based matching anchors each step to a stable identifier: a field label, an HTML attribute, an API key name. Names survive layout changes. They also survive pagination and infinite scroll, which position-based logic handles poorly. The practical rule is simple: if you cannot give a step a meaningful name, the task probably should not be recorded — it should be described instead, so the agent can reason about what it is actually trying to achieve.
- Position-based matching
- Finding an element by where it appears in a layout or data structure. Fast to record, fragile when the interface changes.
- Name-based matching
- Finding an element by a stable identifier such as a label, attribute or API key. Slower to set up, resilient to layout changes.
- Silent failure
- When an automation acts on the wrong target without raising an error. Common with position-based steps after an interface update.
- Graceful degradation
- When an agent detects it cannot match a named element and pauses for human review rather than proceeding on a wrong assumption.
What should never be captured in a recorded task?
Credentials are the obvious answer. Any recording that captures a password, an API key, or a session token creates a secret embedded in an instruction file. Instruction files get shared, version-controlled, and sometimes exported. The correct pattern is to record the shape of the authentication step — 'enter the API key from the secure vault' — and resolve the actual value at runtime from a secrets store the agent has permission to read.
Personal data about third parties is a less obvious but equally important exclusion. If you record a task that processes customer records, the recording itself should reference the data source, not a specific row you happened to use during the demonstration. A recording containing a real customer's name, address or payment detail is a data handling problem waiting to surface during an audit. Use synthetic or anonymised examples when teaching a task that will later run against live personal data.
- Passwords, API keys and session tokens — resolve these at runtime from a secrets store.
- Personal data used during the demonstration — substitute synthetic or anonymised records.
- Hardcoded file paths that only exist on your machine — use relative paths or environment variables.
- Timestamps recorded as literal values — capture the logic ('yesterday's date') not the value ('2026-08-15').
- UI coordinates — replace with named selectors before saving the recording.
When is a simpler tool the better choice?
A spreadsheet macro, a shell script, or a no-code automation tool is often the right answer for a task that is purely linear, touches only one application, and never needs to reason about context. These tools are auditable, version-controllable, and understood by more people than an agent instruction file.
An agent adds value when the task crosses multiple tools, requires judgement at decision points, or needs to handle exceptions that a rigid script would simply crash on. If you find yourself recording a task that has no branches and no ambiguity, ask whether a simpler automation would be easier to maintain. GROX Circuits are designed for exactly the cases where the task is genuinely multi-step and context-dependent — not as a replacement for a three-line script.
Common questions
Can an AI agent learn from a single demonstration without any written instructions?
It depends on the agent. Some can infer a repeatable routine from one observed execution, but the resulting routine is only as reliable as the observation. A single demonstration rarely covers edge cases — what happens when a field is empty, a network request times out, or a value falls outside the expected range. A demonstration is a starting point, not a finished specification.
How do I know if a recorded task has broken after an interface update?
The safest signal is an explicit error raised when the agent cannot match a named element. Position-based recordings often do not raise errors — they act on the wrong target and appear to succeed. Build in a verification step: after the task runs, check that the output matches an expected shape or range. If it does not, the task should pause and request human review rather than continue.
Is it safe to share a recorded task with a colleague?
Yes, provided you have followed the rules above: no credentials, no personal data, no machine-specific paths. A well-named, secrets-free recording is a portable instruction set. The colleague's agent resolves credentials from their own vault at runtime. If you are unsure whether a recording is clean, open it as plain text and search for anything that looks like a password, key, or real person's name before sharing.
What is a SKILL.md file and how does it relate to teaching an agent a task?
A SKILL.md file is a structured document that defines a capability an agent can import and invoke by handle. Rather than recording a live execution, you describe the task's purpose, inputs, outputs and constraints in a format the agent can parse. It is closer to the 'description' end of the spectrum than the 'recording' end, which makes it more readable, easier to audit, and more resilient to interface changes.
GROX Circuits let you build reusable automations that combine recorded steps with agent reasoning — see how at grox.life.