Documentation menu
Start here
IntroductionGetting startedWrite an agentProject anatomyUnderstand Ayjnt
Harness engineeringTwo runtimesHuman interfacesHow agents workHost bridgeAgent capabilities
Callable methodsState & SQLiteSessions & memorySchedulingWorkflowsDurable executionInter-agent RPCSub-agentsToolsWebAssembly modulesInterfaces & integrations
Browser clientRouting & middlewareVoiceBrowser toolsMCPEmailObservabilityCLI
Command overviewnewdevrunbuildcompilemigratedeployAPI reference
AgentAgentClientWorkflow classesLocal & cloudMigrationsExamplesThe host bridge
Let isolated agents request narrow, permission-aware actions from a Bun host.
A boundary, not a shared global
Agent code runs in workerd. Host tools run in Bun. Ayjnt sends a tool description and validated input across a private bridge; the Bun implementation never ships into the isolate.
The bridge is active under ayjnt run and compiled executables. Deployed Cloudflare Workers have no Bun host process, so host tools are rejected unless explicitly marked optional on deploy.
Declare side effects
| sideEffects | Runtime permission |
|---|---|
| read | Allowed by default |
| write | Requires --allow-host-writes |
| exec | Requires --allow-host-exec |
import { z } from "zod";
import { confinePath, hostTool } from "ayjnt/tools";
const root = process.cwd();
export const readProjectFile = hostTool({
description: "Read a UTF-8 file inside the project.",
sideEffects: "read",
inputSchema: z.object({ path: z.string() }),
execute: ({ path }) => Bun.file(confinePath(root, path)).text(),
});