
A teardown of Notion's Workers Config UI — the TypeScript editor + deployment flow shipped May 13 2026 — showing how `readOnlyHint`, `.describe()` field annotations, and the CLI's capability-diff output encode behavioral permissions directly in code rather than in a settings panel. Extracts the "permission-as-code" pattern: agent behavioral contracts expressed as typed declarations in version-controlled code, making permission changes reviewable in pull requests.
Worker instance using six primitives: worker.tool(), worker.sync(), worker.webhook(), worker.database(), worker.oauth(), and worker.pacer(). 1 The right side shows a Notion Custom Agent conversation, demonstrating how the registered tool surfaces in practice — the agent receives a request, calls the tool by name, and returns structured output to the user.
title (shown in the Notion UI), a description, and a schema defining the input structure. 2 The schema uses a builder called j rather than raw JSON Schema — j.object({ email: j.email().describe("The customer's email address.") }) — so every field definition includes an inline .describe() call..describe() call is not documentation for the developer. Notion's guidance is explicit: "write the description as an instruction boundary — what the tool does, and when it should be used." 2 The agent reads those strings at runtime to decide whether to invoke the tool and what arguments to pass. The developer's description text becomes the agent's routing logic.readOnlyHint. Setting this boolean to true marks a tool as safe to auto-execute — the agent calls it without asking the user for confirmation. 2 Leave it unset on a write tool, and the agent will prompt the user before executing. A PM looking at this UI is seeing an authorization model expressed in a type annotation, not a settings panel.ntn, a CLI installed via a single curl command on macOS/Linux (Windows requires WSL). 1 The deploy command — ntn workers deploy — handles TypeScript compilation, dependency bundling, and upload. What's notable is what the CLI outputs when the deploy completes: a message showing exactly which capabilities were added and which were removed.
ntn workers exec <toolKey> --local -d '<json>' before deploying, and use the --preview flag for dry-run testing post-deployment. 4 The local execution mode runs code against external APIs without writing back to Notion — a meaningful distinction when the tool in question touches production data.ntn workers env set KEY=VALUE are never placed inside the execution environment. They're injected at the network level through Vercel Sandbox's firewall proxy, meaning a successful prompt injection attack against the running code still can't exfiltrate the credentials — they're not there to steal. 5process.env.KEY. The security model is entirely invisible in the UI.readOnlyHint: true on a revenue-query tool means no human had to configure "this tool is safe to auto-run" in a dashboard — the constraint is in the codebase, version-controlled, reviewable in a pull request.readOnlyHint annotation in a TypeScript file is not.developers.notion.com
thomas-wiegold.com
这条内容由频道自动生产。你也可以用一句话,让 Neodrop 为你持续生产。