---
id: KB-CL-006
url: https://app.codecontract.io/help/collaboration/an-agent-that-fetches-the-document
idioma: en
categoria: colaboracion
subcategoria: automatico
audiencia: usuario
nivel: intermedio
actualizado: 2026-08-13
tambienEn: [es]
relacionados: [KB-CL-004, KB-CL-002]
citadoPor: [KB-CL-007]
enLaApp: https://app.codecontract.io/agents
---

# An agent that goes and fetches the document

_When the document is not held by a person but by a portal you have to log into._

**Responde a:** automatically download documents from a government portal · agent that logs into a portal to fetch a certificate · automate certificate downloads · ai agent that browses websites

Not all the documentation you are missing is held by a person. Much of it sits in a portal — a government site, a customer's web area, an insurer's private area — and someone on your team has to log in, find it and download it. That can be delegated too.

## The three things it can do

| Task | What it does | Example |
| --- | --- | --- |
| Fetch | Logs in, locates the document or data and brings it back | Downloading a certificate from a government portal |
| Deliver | Logs in, uploads or fills in what you give it and confirms | Submitting documentation on a customer's portal |
| Review | Looks at what is there and proposes approving or rejecting with a reason | Checking a certificate meets what was required |

## Where it always stops

At a CAPTCHA. The agent does not solve it and does not try: it reports that a person is needed and waits. The same goes for any step requiring a decision you have not delegated to it.

> [!IMPORTANT]
> That it **can review and propose** approving or rejecting does not mean it should decide alone. Approving a document has consequences that remain yours: leave it proposing and have a person confirm, at least until you have spent weeks seeing it get things right.

## Before you delegate anything: the awkward conversation

Logging into a portal requires credentials, and in some cases your company's digital certificate. That is not a configuration detail: it is granting access to an official portal in your name.

**En corto**

- Decide expressly which portals yes and which no.
- Start with the lowest-consequence ones, not the tax authority.
- Read the full log of the first runs, not a glance.

> [!WARNING]
> Also check that doing it this way is permitted by that portal's terms of use. Some official sites and private areas expressly prohibit automated access, and the platform cannot know that for you — ask your adviser before automating a specific one.

## What gets recorded

Everything: what it did, in what order, what it found and where it stopped. Each run leaves a full log, and that is what lets you understand what happened when something does not go as expected.

> [!NOTE]
> A job consumes several times over: running it, logging the activity and storing the result each count separately. It consumes more than asking a person for the document, and pays off when that person is you logging into the portal every month.

**What if the portal changes its layout?**

It may fail, and it will say so. It does not invent a result it could not obtain.

**Can I see what it did?**

Yes, the full log of each run.

**Does it work on any website?**

On those navigable like a person would. With a CAPTCHA or two-factor, a person will be needed.

## Ejemplos

**A firm downloads the same certificate from a portal for 40 clients every month.**

- Delegates fetching to an agent
- Reads the full log of the first runs
- Keeps a person confirming before accepting the result

→ The 40 downloads stop taking a morning, and when the portal changes the agent reports it instead of bringing back the wrong thing.

**A supplier document is missing and somebody spends twenty minutes writing to them and hunting for it.**

- Lets the agent identify what is missing and who to ask
- Reviews the message before it goes out
- Checks afterwards what it obtained and what it did not

→ Twenty minutes become two of review, and the supplier receives a correct request.

**The agent asks for something already delivered.**

- Checks it consults the status before asking

→ Nobody receives a request for what they already sent.

**The agent writes in a tone that is not yours.**

- Reviews and adjusts the template it uses

→ The message sounds like your company.

**The agent chases daily and the supplier stops reading.**

- Configures the cadence

→ The nudge works again.

**The agent fails to obtain the document and nobody knows.**

- Checks which attempts came back empty

→ The case moves to a person when it should.

**The agent contacts somebody who has left the company.**

- Checks it uses the current contact

→ The request reaches somebody who can act.

**It is asked to obtain something that does not exist.**

- Checks first whether the document can exist

→ The impossible is not chased.
