Skip to content

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

FieldPurposeGuidance
ArtifactThe particle to install

A .particle file built with particle build --pack, at most 256 MB. The mesh reads its manifest to show the tools, capabilities and credential slots below.

NameIdentifies 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.

CapabilitiesWhat 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

FieldPurposeGuidance
KV workspaceKey/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.

MountsFile 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

FieldPurposeGuidance
MethodHow 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

FieldPurposeGuidance
PingHealth check

Calls the particle’s ping handler. Results are Healthy, Degraded, Unhealthy or No ping handler.

Replace artifactUpgrade in place

Upload a new .particle. The page shows capability changes for you to accept, and Revert restores the previous artifact.

ToolsBrowse and run tools

The same tool explorer as MCP connections. Run a tool by hand to check credentials and arguments.

On an Agent

FieldPurposeGuidance
FilterWhich tools the agent sees

All tools, Selected tools, or Tools matching a pattern (a regular expression such as ^(read|write)_.*). Expose only what the agent needs.

Installing a particle

  1. Open Tools, then Particles.
  2. Select Install particle.
  3. Upload the .particle file.
  4. Enter a name for the install.
  5. Read the capabilities and accept them.
  6. Choose a Workspace for the KV state and for each mount.
  7. Fill in each credential slot.
  8. 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.

SourceRuns inPackages
Particlefile.ts or Particlefile.jsQuickJS, a JavaScript engine compiled to WebAssemblynpm 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.pyCPython 3.14 compiled to WebAssemblyPyPI 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 componentItselfAny 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 particle CLI. Download it from the repository’s releases, or build it with Go 1.26 or later: run go build -o particle ./cmd/particle in a clone.
  • examples/: is-odd (no capabilities), github and github-py (HTTP and credentials, in TypeScript and Python), file-copy (mounts) and sheets-analytics. duckdb-github uses 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-typescript and write-particle-python, that teach a coding agent to write a particle.
  • js-types/: the TypeScript types, such as Particle from @partite-ai/particle.

What a particle declares

The default export (TypeScript and JavaScript) or the module-level particle variable (Python) declares:

  • name in kebab-case, description, and version in 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 a description, an absolute path inside the sandbox, an access of readonly or readwrite, and required. At install, each mount gets a workspace.
    • filesystem.temp declares 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, with hosts, required and the methods the user can choose from: apikey, basic, oauth2, signing-key or raw. The particle’s code gets a placeholder, and the mesh puts the real value into requests to the credential’s hosts. A signing-key signs data without the key entering the sandbox. Only the value of a raw credential reaches the particle’s code.
  • tools: each tool has a description for the model, an inputSchema (JSON Schema with an object root), a handler, and optionally an outputSchema. 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 of ok, degraded or unhealthy, 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:

InterfaceFunctionsWhat they do
manifestget-manifestReturns the name, version, capabilities, credentials and tools. The build calls it.
toolslist-tools, call-toolcall-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.
healthpingReturns the status, or not-implemented when the particle has no health check.

The host gives the particle these imports:

InterfaceFunctions
particle:host/credentialsget-placeholder, get-raw, get-configured-method
particle:host/oauthrefresh, to force a new token
particle:host/signingsign, verify
particle:host/kvget, set, delete, list
wasi:http 0.2.3Outbound HTTP. Each request is checked against allowedHosts, and credential placeholders are replaced.
wasi:filesystemThe mounts, at their declared paths

The files in wit/deps define the imports.

Build, try and upload

  1. Put Particlefile.ts, Particlefile.js or Particlefile.py in an empty folder.
  2. Run particle build in 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.
  3. Try it. particle run <name> <tool> --help lists a tool’s arguments, and particle 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.
  4. Run particle build --pack. It writes <name>-<version>.particle.
  5. Upload the file: install it under Tools > Particles, or use the partiteai_particle_artifact Terraform 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

LimitSelf-hostedHosted service
Memory of one particlePARTICLE_MEMORY_LIMIT_MB, 16 MB by default64 MB
Run time of one tool callPARTICLE_TOOL_CALL_TIMEOUT, 3 seconds by default3 seconds
Outbound addressesAny host the manifest allowsPublic 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 .particle file 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