Agents
Confetti Agents make it possible to automate workflows between packages and containers in a structured and reusable way.
Combined with the package system and isolated Docker containers described in the Packages documentation, you can create self-contained AI workflows that react to events happening inside your project.
A Confetti Agent is a container that listens for events triggered by other containers.
For example:
- A user uploads an image
- A markdown file is saved
- A text field is updated
- A PDF is generated
When an event occurs, another container can expose files or directories to the agent container. The agent then receives instructions written in Markdown and can modify files automatically.
This allows you to create reusable AI-powered automations that can easily be shared between projects.
You can expose files from one container to another using sync_granted.
In this example, uploaded images are shared with the agent container whenever a file is saved.
{
description: "This package allows you to upload and edit images in the dashboard.",
"sync_granted": [
{
description: "Let the AI Container modify the uploaded images",
scheme: "image",
expose_path: "/var/storage",
container_name: "agent",
options: {
events: {
saved: [
"agent/make_image_gray.md"
],
},
},
},
],
}- The
imagecontainer saves a file - The
/var/storagedirectory becomes accessible to theagentcontainer - The agent receives the Markdown instruction file
- The agent performs the requested task
- The modified files are synced back automatically
This makes it possible to create advanced workflows without tightly coupling services together.
You can create the file:
agent/make_image_gray.mdInside the file, you can provide instructions to the AI agent.
# Task
Whenever a new image is added, convert the image to grayscale.
# Requirements
- Only process newly added images
- Keep the original file name
- Overwrite the existing image
- Ignore unsupported file formats
- Preserve transparency for PNG files
- Do not resize or crop the image
# Expected Result
All uploaded images should automatically appear in grayscale after being saved.This allows you to build reusable AI-powered image pipelines directly inside your packages.
Agents are not limited to images. You can also modify text content automatically.
For example, when a text file or content block is saved, you may want to sanitize offensive language before publishing.
{
description: "This package allows you to upload and edit images in the dashboard.",
"sync_granted": [
{
description: "Allow the AI agent to sanitize text",
scheme: "content",
expose_path: "/var/storage/content.db",
container_name: "agent",
options: {
events: {
saved: [
"agent/remove_offensive_words.md"
],
},
},
},
],
}Create the following instruction file:
agent/remove_offensive_words.md# Task
Whenever text content is saved, remove offensive or inappropriate language.
# Requirements
- Replace offensive words with a neutral alternative
- Preserve grammar and readability
- Keep the original formatting intact
- Only modify the content when necessary
- Do not rewrite the entire text
# Examples
"This product is damn bad"
→ "This product is very bad"
"You are stupid"
→ "Your message contains inappropriate language"
# Expected Result
Saved content should automatically be sanitized before becoming publicly visible.The Agent automatically receives information about which files were added or modified during the event. This can include a single file or multiple files at the same time.
This makes it possible to build more advanced workflows where files depend on each other.
For example:
- Combine multiple uploaded images into a PDF
- Generate a ZIP archive from uploaded assets
- Create thumbnails for an entire image batch
- Merge multiple markdown files into a single document
- Analyze several documents together before generating a summary
The Agent receives the relevant file paths automatically, so you only need to describe the desired behavior inside the Markdown instruction file.
Most AI tooling today is built around prompts inside a chat window. Confetti Agents are different because they are integrated directly into your infrastructure and package ecosystem.
This makes it possible to:
- Reuse AI workflows across projects
- Isolate automations in dedicated containers
- Keep business logic modular
- Automate repetitive agency work
- Share AI-powered packages internally or publicly
- Eventually monetize workflows through the Confetti Marketplace
Because agents live inside packages, they naturally evolve together with your projects over time.