.prompt and .agent Files
Human-readable formats for Prompts and Agents that can be stored alongside your source code.

Humanloop provides serialized File formats (.prompt
, .agent
) for storing Prompts and Agents as human-readable, version-control-friendly files.
These formats enable you to integrate your Prompts and Agents into standard software development workflows.
File Types
Humanloop currently supports the following File formats:
Usage
The Humanloop SDK supports working with local Files in your codebase, enabling a code-first development approach.
For detailed instructions on syncing and using local Files, see our Store Prompts in code guide.
Format Structure
Both .prompt
and .agent
files follow the same basic structure:
- YAML frontmatter section (enclosed between
---
): Contains all configuration parameters including model selection, generation parameters, and tool definitions. The frontmatter defines how the Prompt or Agent will execute when called. - JSX-inspired content section: Contains the template content with a syntax similar to JSX. This includes system messages,
user prompts, and variable placeholders using
{{variable_name}}
syntax.
The formats are nearly identical, with .agent
files having just two additional parameters (max_iterations
and tools[].on_agent_call
) to control execution flow.
Basic Format Example
Currently, we only support pulling these Files from Humanloop to your local environment. However, you can modify local Files and use them directly - when the SDK detects changes to a File, it automatically creates a new version for that path. Two-way synchronization is coming soon.
Multi-modality and images
Images can be specified using nested <image>
tags within a <user>
message. To specify text alongside the image, use a <text>
tag.
Currently, the url
attribute only supports remote URLs (https://
). Local file paths are not supported yet, though we’re exploring this capability for future releases.
Tools, tool calls, and tool responses
Tools are specified in the YAML header as a JSON array. Both .prompt
and .agent
files can include tools,
though .agent
files include additional configuration for tool execution control.
Assistant messages can contain either text or tool requests. For tool requests, use a <tool>
tag within an <assistant>
tag with attributes name
and id
. The text wrapped in the <tool>
tag should be a JSON-formatted string containing the tool call’s arguments.
Tool responses can then be added with standalone <tool>
tags after the <assistant>
message,
using the same name
and id
to link the response to the request.
Related Resources
- Store Files in code - Detailed guide on how to store serialized Files in your codebase
- Prompts - Learn more about how Prompts work in Humanloop
- Agents - Learn more about how Agents work in Humanloop