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)
- Element names are lower-case ASCII and case-sensitive:
pf:a,pf:embed, etc. - Start tags use
<pf:name ...>; empty tags use<pf:name ... />; matching closing tags use</pf:name>. - Attribute names are lower-case ASCII with internal hyphens; values MUST be double-quoted strings.
- Literal
&,",<,>inside attribute values MUST be represented by&,",<,>respectively. These four entities are decoded once; no other entity syntax is recognized. - A tag is recognized only if it fully satisfies this grammar and has a registered element name.
- Unsupported or malformed markup MUST be left as plain body text and MUST NOT trigger effects.
- A recognized element can be surrounded by ordinary prose. Outside known paired tags, regular body text has no mandated markup semantics.
- PFS-aware editors SHOULD preserve unknown text and unknown XML-like tags verbatim.
- Only recognized PFS elements are interpreted; no JavaScript or arbitrary XML evaluation occurs.
- To show literal PFS markup, write
<pf:a ...>in body text; a plain-text renderer MAY display these escapes literally. If a client implements Markdown rendering, it MUST NOT activate tags within fenced or inline code spans.
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.
3.3 Links and anchors
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" />
prefmeans persona/resource reference. Its value is a standard URI reference, not a new URI scheme.- An
pf:aMAY point to a non-Personafile resource; in that case the client SHOULD use its normal resource handler. - The reference MAY be relative or absolute.
pf:sectionuses<pf:section id="pricing">...content...</pf:section>; its content belongs to the main document.- Anchor IDs MUST be unique within the resolved document and SHOULD
match
[A-Za-z][A-Za-z0-9._-]*. Unresolved fragments are nonfatal navigation errors. - Links do not execute, embed, or elevate the destination.
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.