AgentProfile
Portable agent profile definition — schema and parser.
AgentProfile defines a single PROFILE.md file that captures everything needed to instantiate an AI agent: identity metadata, model, tools, skills, system prompt, runtime limits, and pointers to companion config files. The format follows the SKILL.md convention — YAML frontmatter for metadata, Markdown body for the system prompt.
Installation
pip install agentprofile
Requires Python ≥ 3.11, < 3.14.
Quick start
Create a PROFILE.md:
---
name: research-assistant
description: Web research agent that summarizes findings with citations
model: gpt-4o-mini
tools:
- web_search
tags:
- research
---
You are a research assistant. Always cite sources with URLs.
Prefer primary sources. Be concise.
Load it:
from agentprofile import load_profile
profile = load_profile("PROFILE.md")
profile.name # "research-assistant"
profile.model # "gpt-4o-mini"
profile.tools # ["web_search"]
profile.system_prompt # "You are a research assistant. Always cite sources..."
Round-trip back to PROFILE.md:
from agentprofile import dumps_profile
md_text = dumps_profile(profile)
Or parse from a string (no file I/O):
from agentprofile import loads_profile
profile = loads_profile(md_text)
Format
A PROFILE.md has two parts:
- YAML frontmatter (between
---delimiters) — structured metadata - Markdown body — becomes the agent's
system_prompt(unless overridden by asystem_promptkey in frontmatter)
A file without frontmatter is treated entirely as the system prompt.
Frontmatter fields
| Field | Type | Default | Description |
|---|---|---|---|
version |
int | 1 |
Profile schema version |
name |
str | required | Agent name, 1–64 chars, [a-zA-Z0-9_-] only |
description |
str | "" |
Short human-readable description |
model |
str | "" |
Model identifier (e.g. gpt-4o-mini) |
tools |
list[str] | [] |
Tool names available to the agent |
skills |
list[str] | [] |
Skill references |
tags |
list[str] | [] |
Free-form tags |
handoff_instructions |
str | null | null |
Instructions when handing off to another agent |
system_prompt |
str | (body) | System prompt; defaults to Markdown body |
Runtime limits (harness-specific, optional)
| Field | Type | Default | Description |
|---|---|---|---|
max_llm_calls |
int | 50 |
Maximum LLM invocations per run |
cost_limit_usd |
float | 1.0 |
Spend cap per run |
timeout_seconds |
int | 300 |
Wall-clock timeout per run |
Companion files
Frontmatter can point to JSON files in the same directory as the profile; they are auto-loaded when the profile is loaded from disk:
| Pointer | Loads into | Purpose |
|---|---|---|
provider: provider.json |
profile.provider_options |
Provider/model configuration |
output_schema: output-schema.json |
profile.output_schema_def |
Structured output JSON Schema |
Companion contents are kept out of frontmatter serialization (exclude=True), so round-tripping a profile never leaks them into the .md.
profile = load_profile("agents/research/PROFILE.md")
profile.provider_options # dict from provider.json
profile.output_schema_def # dict from output-schema.json
When using loads_profile() on raw text, pass base_dir= to enable companion loading.
Behavior notes
- Validation:
namemust match^[a-zA-Z0-9_-]+$(1–64 chars);versionmust be ≥ 1. - Lenient parsing: unknown frontmatter keys are ignored (
extra="ignore"). - Serialization:
dumps_profile()omits defaults, nulls,system_prompt(moved to the body), and companion-file fields. Pointers (provider,output_schema) are also omitted since they reference sibling files.
API
| Function | Description |
|---|---|
load_profile(path) |
Parse a PROFILE.md from disk, auto-loading companion files |
loads_profile(text, base_dir=None) |
Parse from string; optional base_dir for companions |
dumps_profile(profile) |
Serialize an AgentProfile back to PROFILE.md text |
AgentProfile |
Pydantic model — see field tables above |
Development
uv sync # install deps + dev group
uv run pytest # run tests
License
MIT — see LICENSE.
Metadata
Release files for agentprofile 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| agentprofile-0.2.1.tar.gz | 24.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentprofile-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.4 kB
Release files / agentprofile-0.2.1.tar.gz
| Download URL | agentprofile-0.2.1.tar.gz |
|---|---|
| Size | 24.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66426c5783f417ce118052f475093e6802c45510876b9f0a2aeacc3a1278f849
|
|
BLAKE2b-256 checksum How to use checksums |
f76810782bf78c17a3a7b9d9e3438618d8841e5775ce6a9994d16865f30538e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / agentprofile-0.2.1-py3-none-any.whl
| Download URL | agentprofile-0.2.1-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
51a8a2e0863b8534d69237f9838a4f0db98db3fef2d7c96b8d4905099c07bc4c
|
|
BLAKE2b-256 checksum How to use checksums |
a710aed4132a272e592f2802811079cab8c070f59733b91131f1fe8ab4decca8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for agentprofile 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.