Particles
A particle is a set of tools, implemented in WebAssembly, that agents can use. It runs inside the mesh in a deny-by-default sandbox. The particle has no network, filesystem or environment access unless its manifest declares it.
Use a particle when a system has no MCP server. Use a particle also when the MCP server of a system floods the model with tools you do not want.
The public repository has the CLI, the type definitions, examples and two agent skills for writing particles: partite-ai/particles.
Quick Reference
Install
| Field | Purpose | Guidance |
|---|---|---|
| Artifact | The particle to install | A |
| Name | Identifies the installed particle | Must be unique across installed particles. You pick the install by this name when you add it to an agent. Agents keep the install’s ID, so you can rename it later. |
| Capabilities | What the particle may reach | The outbound HTTP hosts the particle may call, as declared in its manifest. You must tick “I accept these capabilities” to install. A particle cannot reach anything it did not declare. |
Storage
| Field | Purpose | Guidance |
|---|---|---|
| KV workspace | Key/value state | Holds this install’s KV state. Shown when the particle declares the kv capability, and then required. The keys belong to the workspace, so other installs that use the same workspace see them too. See Workspaces. |
| Mounts | File storage | One workspace for each mount the manifest declares, shown with the mount’s path and access. A Global workspace shares files across conversations. A Conversation workspace gives each conversation its own copy, which starts empty. |
Credentials
| Field | Purpose | Guidance |
|---|---|---|
| Method | How a credential is supplied | One per credential slot the manifest declares, chosen from the methods it allows: API key, Basic auth, OAuth 2.0 (Client ID, Client secret, Authorization URL, Device authorization URL, Token URL; supports the device code flow), Raw header, or Signing key. Secrets never enter the particle sandbox; the mesh inserts them on outbound requests to the declared hosts. |
Detail Page
| Field | Purpose | Guidance |
|---|---|---|
| Ping | Health check | Calls the particle’s ping handler. Results are Healthy, Degraded, Unhealthy or No ping handler. |
| Replace artifact | Upgrade in place | Upload a new |
| Tools | Browse and run tools | The same tool explorer as MCP connections. Run a tool by hand to check credentials and arguments. |
On an Agent
| Field | Purpose | Guidance |
|---|---|---|
| Filter | Which tools the agent sees | All tools, Selected tools, or Tools matching a pattern (a regular expression such as |
Installing a particle
- Open Tools, then Particles.
- Select Install particle.
- Upload the
.particlefile. - Enter a name for the install.
- Read the capabilities and accept them.
- Choose a Workspace for the KV state and for each mount.
- Fill in each credential slot.
- Select Install.
To give an agent the tools of the particle, open the agent. Under Tools, select Add tool, then Particle. Choose the install, and set the Filter to expose only the tools the agent needs.
Writing a particle
You write a particle as one source file, or as a WebAssembly component. The particle CLI builds it into a .particle file, which you upload to the mesh.
| Source | Runs in | Packages |
|---|---|---|
Particlefile.ts or Particlefile.js | QuickJS, a JavaScript engine compiled to WebAssembly | npm packages, imported with an npm: specifier such as import isOdd from "npm:is-odd@3.0.1". The build fetches and bundles them. Packages with native code don’t work, and neither do Node modules such as child_process. |
Particlefile.py | CPython 3.14 compiled to WebAssembly | PyPI packages, listed in a PEP 723 block at the top of the file. Pure-Python packages work. A package with C code works only when partite-ai/particle-python-wheels has a WebAssembly build of it: cffi, cryptography, pydantic-core, regex, PyYAML, duckdb, numpy and pandas. |
| A WebAssembly component | Itself | Any language that builds a wasm32-wasip2 component, such as Rust. The component implements the WIT world itself. Package it with particle build --component <file.wasm>. |
Get the CLI
Everything you need is in partite-ai/particles:
- The
particleCLI. Download it from the repository’s releases, or build it with Go 1.26 or later: rungo build -o particle ./cmd/particlein a clone. examples/:is-odd(no capabilities),githubandgithub-py(HTTP and credentials, in TypeScript and Python),file-copy(mounts) andsheets-analytics.duckdb-githubuses duckdb from Python. It declares a temp mount, so it runs with the CLI but not in the mesh.skills/: two agent skills,write-particle-typescriptandwrite-particle-python, that teach a coding agent to write a particle.js-types/: the TypeScript types, such asParticlefrom@partite-ai/particle.
What a particle declares
The default export (TypeScript and JavaScript) or the module-level particle variable (Python) declares:
namein kebab-case,description, andversionin semver.capabilities:http.allowedHosts: the hosts the particle may call. Write each host in full, with no wildcards. A request or a redirect to any other host fails.kv: { enabled: true }: key/value state, kept in a workspace. Without it, every key/value call fails.filesystem.mounts: folders the particle reads or writes. Each mount has adescription, an absolutepathinside the sandbox, anaccessofreadonlyorreadwrite, andrequired. At install, each mount gets a workspace.filesystem.tempdeclares scratch folders that the CLI makes on your machine. The mesh doesn’t provide them: a particle that declares one fails when it runs in the mesh. Use a mount on a Conversation workspace for scratch files.
credentials: one entry for each secret the particle needs, withhosts,requiredand themethodsthe user can choose from:apikey,basic,oauth2,signing-keyorraw. The particle’s code gets a placeholder, and the mesh puts the real value into requests to the credential’s hosts. Asigning-keysigns data without the key entering the sandbox. Only the value of arawcredential reaches the particle’s code.tools: each tool has adescriptionfor the model, aninputSchema(JSON Schema with an object root), ahandler, and optionally anoutputSchema. The mesh checks the arguments against the input schema before the handler runs. The handler returns any JSON value.ping: optional. The health check that Ping runs. It returns a status ofok,degradedorunhealthy, and a message.
Make HTTP, key/value and credential calls only inside a handler or ping. The build runs the file’s top level to read the manifest, and these calls fail there.
This particle keeps short notes in key/value state:
import type { Particle } from "@partite-ai/particle";
import { kv } from "@partite-ai/particle-kv";
export default {
name: "notes",
description: "Saves and reads short notes.",
version: "0.1.0",
capabilities: { kv: { enabled: true } },
tools: {
save_note: {
description: "Save a note under a name. Replaces a note with the same name.",
inputSchema: {
type: "object",
properties: {
name: { type: "string", description: "The note's name" },
text: { type: "string", description: "The note" },
},
required: ["name", "text"],
},
handler: async ({ name, text }: { name: string; text: string }) => {
await kv.set(`note:${name}`, text);
return { saved: name };
},
},
read_note: {
description: "Read the note with a name.",
inputSchema: {
type: "object",
properties: { name: { type: "string", description: "The note's name" } },
required: ["name"],
},
handler: async ({ name }: { name: string }) => ({ text: await kv.get(`note:${name}`) }),
},
},
} satisfies Particle;How a particle runs in the mesh
- Each tool call runs in a new instance of the particle. Nothing in memory carries over from one call to the next. Keep state in key/value state or in files.
- Ping runs with an empty key/value store and an empty folder for each required mount. It checks that the particle starts and can reach its service, not its stored data.
- When you run a tool by hand on the particle’s page, a Conversation workspace is a temporary one. See Calls with no conversation.
The WIT world
Every particle implements the particle:runtime@0.1.0 interfaces in wit/runtime.wit. For JavaScript and Python, the runtime implements them and calls your handlers. A native component implements them itself. Start from the wasm-particle world in wit/wasm-particle.wit and the Rust component in components/wasm-example.
The particle exports:
| Interface | Functions | What they do |
|---|---|---|
manifest | get-manifest | Returns the name, version, capabilities, credentials and tools. The build calls it. |
tools | list-tools, call-tool | call-tool takes the tool name and the arguments as JSON, already checked against the input schema. It returns JSON, or an error: not-found, invalid-arguments, handler-error or capability-denied. |
health | ping | Returns the status, or not-implemented when the particle has no health check. |
The host gives the particle these imports:
| Interface | Functions |
|---|---|
particle:host/credentials | get-placeholder, get-raw, get-configured-method |
particle:host/oauth | refresh, to force a new token |
particle:host/signing | sign, verify |
particle:host/kv | get, set, delete, list |
wasi:http 0.2.3 | Outbound HTTP. Each request is checked against allowedHosts, and credential placeholders are replaced. |
wasi:filesystem | The mounts, at their declared paths |
The files in wit/deps define the imports.
Build, try and upload
- Put
Particlefile.ts,Particlefile.jsorParticlefile.pyin an empty folder. - Run
particle buildin the folder. It resolves the packages, checks TypeScript types, reads the manifest and registers the particle on your machine. The first build asks for the particle’s credentials. - Try it.
particle run <name> <tool> --helplists a tool’s arguments, andparticle run <name> <tool> --<argument>=<value>calls it. To map a mount to a folder for one run, put--mount <mount>=<folder>before the name.particle serve-mcp <name>serves the tools to an MCP client. - Run
particle build --pack. It writes<name>-<version>.particle. - Upload the file: install it under Tools > Particles, or use the
partiteai_particle_artifactTerraform resource. To upgrade an install, use Replace artifact on its page.
On your machine, the CLI keeps each particle’s key/value state apart and keeps credentials in the OS keychain. In the mesh, key/value state is in the workspace you choose, and credentials are set on the install.
Limits
| Limit | Self-hosted | Hosted service |
|---|---|---|
| Memory of one particle | PARTICLE_MEMORY_LIMIT_MB, 16 MB by default | 64 MB |
| Run time of one tool call | PARTICLE_TOOL_CALL_TIMEOUT, 3 seconds by default | 3 seconds |
| Outbound addresses | Any host the manifest allows | Public addresses only |
Run time counts only the time the particle’s own code runs. Time spent waiting on HTTP, key/value and credential calls doesn’t count. A call that runs past its run time or memory fails, and the agent gets an error. On the hosted service, a tool call also ends after 15 minutes in all, waits included.
Other limits:
- A
.particlefile is at most 256 MB, packed or unpacked. Its manifest is at most 1 MB. - A particle has at most 1,000 tools. A tool name is at most 128 characters. A tool’s name, description and schemas together are at most 64 KB.
Related
- Workspaces – storage for KV state and mounts.
- Agents – attach a particle to an agent.
- MCP Connections – the other way to give agents tools.
- Configuration As Code – the
partiteai_particle_artifactandpartiteai_installed_particleresources.