PersonafileSpecification

Body syntax: optional pf: elements

The body is ordinary text. A parser MAY recognize optional XML-inspired inline tags with the prefix pf:. PFS does not require the body to be a well-formed XML document and does not adopt the full XML specification. Tags can appear amid prose, in text files of any extension.

3.1 Element grammar (PFS subset)

For initial interoperability, parsers SHOULD support recognized paired elements without nested PFS elements inside them, except the pf:form children defined in §6. Non-nested inline links are sufficient for version 1.0. A future grammar revision may standardize richer nesting.

3.2 Element registry (core)

Element Required attributes Meaning
<pf:a> pref Navigable reference to a resource
<pf:embed /> pref Incorporate a referenced Personafile's body into the main persona
<pf:asset /> src Declare a media resource, such as image or voice
<pf:section> id Label a semantic text section and anchor target
<pf:anchor /> id Create a named target without a section
<pf:api /> src Declare an OpenAPI description source; no automatic execution
<pf:form> none Declare a platform-neutral data collection/submission form

Each element is OPTIONAL. Elements omitted from this list, such as pf:script, pf:tool, and pf:import, have no normative semantics in 1.0. The profile intentionally avoids inventing a scripting language.

See <pf:a pref="./sales.txt">Sales</pf:a>.
See <pf:a pref="https://example.com/help">Help center</pf:a>.
Jump to <pf:a pref="#pricing">pricing</pf:a>.
<pf:anchor id="pricing" />

3.4 Embedded Personafiles

I am Alex, a travel assistant.
<pf:embed pref="./paris-knowledge.txt" />
I help visitors plan trips.

pf:embed MUST resolve to a valid Personafile. The browser parses it, incorporates the embedded document's body as part of the single primary persona, and preserves the origin boundary internally. Its metadata remains source attribution; the main document's Persona-ID and Name remain authoritative for the active persona. The browser MUST NOT create an independent agent or session solely because of pf:embed.

To avoid ambiguities, the initial version MUST treat embedded content as supporting context, not as a way to override system rules or gain tools/permissions. Any instructions in embedded content remain untrusted subordinate data. Embedded pf:api and pf:form declarations MUST NOT automatically become active; the main Personafile must declare them directly if needed. Embedded text MAY contain links and assets resolved relative to the embedded document's own location.

Recursive inclusion MUST detect cycles using canonical resolved document URIs and abort the repeated inclusion. Recommended hard limits: 5 levels of nesting and 2 MiB of total expanded text by default; implementations MAY enforce stricter limits and MUST indicate partial loading when truncating. Remote embeds require explicit network permission under browser policy.

3.5 Assets

<pf:asset src="./images/avatar.png" type="image/png" />

src is a URI reference. type is an optional media type hint; content MUST be checked before use. The browser MAY render a preview and MUST NOT execute asset content merely because the document refers to it.