ai

The ai global attribute leaves a short instruction for AI agents on an element, for example <style ai="DO NOT EDIT">. It is a convention between you and the agents that work in your source.

Syntax

html
<style ai="DO NOT EDIT">…</style>
<section ai="Keep this wording. Ask before changing it.">…</section>

Value

instruction

A short instruction about how an agent should treat the element: what it may or may not do with it. There is no fixed vocabulary. Quote a value that contains spaces.

Description

ai is a convention. The playground does not process it, RTEdge.net does not act on it, and deploy keeps it in the served HTML as an inert attribute.

Agents learn about it from the guidance that Agent Folder Share writes into your folder. AGENTS.md and CLAUDE.md are identical files, generated each time you share. Their section on HTML global attributes describes ai as the place for short instructions from humans about an agent's treatment of one element. Codex, Claude Code and any agent that reads AGENTS.md or CLAUDE.md learn about it from there. See Agent Folder Share and Agent files.

Usage notes

Agents decide

Nothing enforces the instruction: an agent reads it as text. Keep it short and specific, and say what you want rather than what you fear.

Where agents read it

With Agent Folder Share active, your source is in 📄.html in the shared folder, attributes included, so an agent sees the instruction next to the element. See File Sync.

The attribute is public

Deploy strips attributes that start with i:, o:, io:, edge:, h: and worker:, but not ai. The served page keeps it, so anyone can read it. Do not put private information in an ai instruction.

Examples

Protecting vendored and generated code

html
<script i:=//js.rt.ht/retry/.js ai="Vendored copy. Do not edit it; refetch with Input: Fetch [i:]."></script>
<style ai="DO NOT EDIT">
  :root { color-scheme: light dark }
</style>

The first script is filled by i:, so an edit made by hand is overwritten by the next fetch. The instruction tells an agent to refetch instead.

Specifications

Not part of any specification. ai is an RTCode.io convention for agents. It sits beside the standard global attributes.

Availability

FeaturePlaygroundRTEdge.netNotes
An ai instruction read by agentsYesNoThrough the guidance that Agent Folder Share writes. Chrome or Edge on desktop.
Processed by RTCode.io or RTEdge.netNoNoThe attribute is only read by agents.
In the deployed pageKeptKeptNot stripped on deploy.

See also