MirLabs / The blog / Security / AI

A door for AI agents on your site: who guards it?

LiaScan now looks for the doors your site opens to AI agents: MCP, an ARD catalogue, poppy.json, WebMCP. An open door has to be guarded: here is how.

· Cyril Delage · 5 min read · Lire en français

A door ajar in a dark room, a strip of light on the floor
Photo: Lan Gao on Unsplash

For twenty years, a website served pages to people. Then to robots that read. Now it also serves AI agents that act: they book, order and ask for quotes on someone's behalf. To do that, they look for a door.

In the last few days, LiaScan learned to recognise several new doors. That is good news for being found. It also raises a security question few people ask: a door open to agents, who guards it?

The doors LiaScan looks for

LiaScan's free test gives two scores. The first says what an AI understands of your site today. The second, "act", says whether an agent could do something there for a customer. In that second score, one of the two heaviest checks is called "A door for assistants". It weighs 40 points.

Lia, the test robot, no longer stops at an MCP server card or an API catalogue. Here is what she looks for, taken from the real code:

foreach (['/.well-known/mcp.json' => 'mcp', '/.well-known/mcp/server-card.json' => 'mcp',
    '/.well-known/api-catalog' => 'api-catalog',
    '/.well-known/poppy.json' => 'poppy',            // what a personal agent may do here
    '/.well-known/ard.json' => 'ard', '/.well-known/ai-catalog.json' => 'ard',  // ARD catalogue
] as $path => $name) { /* … */ }

// WebMCP tools offered by the page itself
if (preg_match('#navigator\.modelContext\b|<form\b[^>]*\btoolname\s*=#i', $html)) {
    $doors['webmcp'] = 'webmcp';
}

So there are three families of doors. Files neatly stored under /.well-known/ that describe your services to agents (MCP, API catalogue, ARD catalogue, Personal Agent Protocol). Links placed in the page or in llms.txt to an API description. And, more recently, WebMCP tools: the page itself declares to the browser actions an agent can call, such as "book an appointment" or "add to cart".

Without any door, an agent that wants to act on your site has to imitate a visitor: click, fill in, guess. It often gets it wrong. With a door, it knows what to do. That is why LiaScan counts it.

An open door is an attack surface

This is the part integration guides leave out. A door for agents is not one more page. It is a list of actions a machine can trigger without going through your screens, and so without going through the safeguards your screens held: the confirmation, the greyed-out field, the button only the right customers see.

And the agent knocking at that door is not always the one you imagine. It may act for an honest customer. It may also have read, a few seconds earlier, a booby-trapped page telling it to cancel all of today's bookings, or to order a hundred times. It may be talked by an insistent user into believing a refund is "already approved by customer service".

Nobody is ready for this. Not because teams are bad, but because the doors are arriving faster than the guards.

Three guards, each in its place

Open a door, yes. But with what it takes behind it.

Rules on the action, not in the prompt. An instruction written to the model ("never refund more than €50") is a request, not a rule. The rule has to live in the code that runs the action: who is allowed, up to what amount, how many times an hour, and when a person must approve. That is what my open source bundle Tool Guard does for a Symfony application, with PHP attributes on each tool and a stop button for when things go off the rails.

An agent tested before it serves. If your own agent greets your customers, you need to know what it does when pushed to misbehave, before a stranger finds out. That is CrashMire's job: crash tests for AI agents, replayed at every release. Crash-testing AI agents is a public service.

A site that recognises attacks. A door for agents also draws the bots that probe it. My Sentinelle bundle spots attacks inside the Symfony application itself and blocks the address, with an alert when something really gets through.

Lia guards her own doors too

A tool that visits addresses given by strangers is a target itself. The classic trap is called SSRF: you give the robot an address that points inside the server (a database, an admin console, a host's metadata), and it reads it for you.

Lia refuses. Before every request, and again after every redirect, she resolves the name and checks that every address she gets is public:

public static function isPublic(string $ip): bool
{
    return false !== filter_var($ip, \FILTER_VALIDATE_IP, \FILTER_FLAG_NO_PRIV_RANGE | \FILTER_FLAG_NO_RES_RANGE)
        // ranges filter_var lets through: carrier-grade NAT, benchmarks, IPv6 unique-local and mapped
        && !preg_match('/^(100\.(6[4-9]|[7-9]\d|1[01]\d|12[0-7])\.|198\.1[89]\.|0\.)/', $ip)
        && !preg_match('/^(f[cd]|fe[89ab])/i', $ip)
        && !str_starts_with(strtolower($ip), '::ffff:');
}

Two details make it solid. Redirects are never followed automatically: each hop is checked like a new address, so a public site cannot send Lia inside. And the connection goes to the IP address that was just checked, not to a name resolved a second time that might have changed in between. Add a maximum response size and a short timeout, and a hostile site can neither hijack her nor wear her out.

It is the same idea as for your doors: you do not trust what comes from outside, you check at every step.

What I recommend

Start by knowing where you stand. The LiaScan test is free, needs no sign-up and takes a minute: it tells you whether your site has a door for agents, which one, and what an AI understands of you.

If you already have a door, or a chat assistant that acts for your customers, look at what is behind it. Try to make Léa, CrashMire's demo assistant, slip: in a few messages you will see what an agent without safeguards is willing to do. And if your application runs on Symfony, put the rules on the tools themselves with Tool Guard.

A door for agents is the future of your site. A door without a guard is an invitation.

A project like this one?AI integration, a site to make readable by assistants, security: let's talk.
Contact me

Read next