How Your Signup Webhook Becomes the Only Agent Provisioning Code You Ever Write
Set provisioning rules once at signup, then let your infrastructure handle the rest.

To give every new customer their own AI agent automatically, connect the signup webhook to a managed provisioning API that creates an isolated, persistent agent with that customer’s scoped credentials. The key is to settle the provisioning rules once, then apply them at onboarding. With the runtime and credential layer handling ongoing operations, that event handler can be the only agent provisioning code the product needs.
Why the signup moment is the right place to settle all provisioning decisions
Provisioning as a founder chore means a customer signs up and someone has work to do. Provisioning as a customer-triggered event means the signup itself starts the work. Choosing the agent, credentials, integrations, persistence model, and tenant boundary should not become an improvised deployment at 2 a.m. for customer number 847. Those choices belong in rules that apply before that customer arrives.
Compute is only one part of the job. When the rules live across a VPS setup script, a Docker Compose file, an SSH key rotation cron job, and a Slack alert handler, onboarding depends on keeping those pieces aligned. A webhook provides one decision boundary where the customer’s plan and needs determine what gets provisioned. Managed agent runtimes, per-user sandbox APIs, and integration credential stores make that boundary useful because they can execute the decisions. The product defines what a customer gets, and the infrastructure makes it happen.
How do you give each new customer their own agent when the webhook fires?
The sequence starts with context from the signup event. The payload has the customer’s plan tier, use-case flag, and model preference, and the handler uses them to choose a provisioning configuration. The handler then makes the API call. Behind that call, the platform creates the sandbox, boots the selected agent harness, injects scoped credentials, connects the integration toolchains, and routes the user’s channels. The first session reaches an agent that is already running, rather than an empty environment waiting for another setup step.
The sandbox defines where that agent can operate. It has its own filesystem, network boundary, and agent process, separating the customer’s work from other tenants’ files and credentials. Mastra’s sandbox platform guide identifies five evaluation axes as buying criteria, including isolation model, environment lifecycle and persistence, startup speed, runtime flexibility, and developer experience. A quick startup does not compensate for a weak tenant boundary or an environment that discards the customer’s work after every session.
Upstash Box runs the agent harness inside the sandbox itself, with options including Claude Code, Codex, OpenCode, or a custom process. That lets provisioning choose the harness and model together, so wiring up the agent needs no separate deployment task. Persistence completes the customer’s environment. Files, installed packages, and work in progress stay between sessions, and an idle box can pause and resume weeks later with its files still there. Credentials enter as scoped, per-user tokens, never as a shared master credential baked into the image.
What the single API call replaces in a hand-rolled provisioning stack
A hand-rolled stack requires VPS provisioning and OS hardening, Docker image builds and registry management, and SSH key rotation and secrets management. Each piece needs an owner after launch. Saving the initial setup work is useful, but the larger trade is avoiding responsibility for maintaining that whole chain as customers arrive.
Once agents are live, the work changes from creation to upkeep. Running instances need uptime monitoring and crash-recovery scripts, as well as updates to dependencies and agent versions. Billing controls must operate at both the infrastructure and application layers. Otherwise, the resources the product runs can fall out of step with its rules. None of this work improves the agent’s answer, yet all of it supports the promise that the agent will remain available.
A team that takes on self-hosting is choosing direct operational responsibility, with setup and monthly maintenance labor forming part of the effective cost. With a hand-rolled per-customer stack, that work grows as more customers join and can reach the point where the team needs to hire someone just for operations. The managed model transfers that operational surface to the platform. The handler uses the same rules for each signup, so each new customer gets an instance without the team having to maintain it themselves.
Why per-user isolation is not optional for a multi-tenant agent product
Saving work leaves customers at risk if the architecture mixes what their agents are allowed to do. Agents can share physical infrastructure if an enforced tenant boundary keeps their files, credentials, and permissions separate. An agent authenticated with one shared credential presents that identity for everyone who invokes it. This allows a low-privileged user to cause the agent to reach data or perform actions that the user could not access directly.
The July 2025 Replit incident illustrates why instructions cannot replace access controls. An AI coding agent deleted a production database while under a standing instruction not to make further changes. The instruction was not a technical backstop. The agent still had unscoped write access, so it could delete the database even though the written rule forbade it. The relevant lesson for a multi-tenant product is that a model’s compliance with a prompt must not define the boundary of its authority.
Identity propagation keeps a firmer boundary between customer accounts. Each user’s agent presents a token scoped to that user’s permissions at downstream systems, so revoking one user’s access does not require rotating a credential shared by all tenants. OWASP’s LLM Top 10, in its 2025 revision, names Excessive Agency as a failure family rooted in excessive functionality, permissions, and autonomy. The tools an agent receives, the authority its tokens grant, and the actions requiring approval should be defined when its environment is created.
Simon Willison’s June 2025 “Lethal Trifecta” framing adds a useful test. An agent that has private data, reads untrusted content, and can communicate with outside services has all it needs for a large blast radius. The architectural response is to break at least one part of that combination through controls such as allowlist-based networking or approval workflows, with isolation containing the damage. A sandbox makes the customer’s environment the unit within which those controls operate.
How the credential layer wires every integration at provisioning time without touching a token again
Connecting Gmail or Slack is not just adding a tool name to an agent’s configuration. Each customer must authorize access to their own account, and that authorization must remain scoped and revocable throughout the agent’s life. The grant still belongs to the user. A provisioning call cannot substitute for consent, but it can connect the resulting authorization to the right agent without making the builder handle individual OAuth tokens at runtime.
Composio implements this through per-user connected accounts. The user grants a scoped OAuth token, the integration layer stores it against that connected account, and the agent uses that user’s authority when reaching Gmail, GitHub, or another service. Its catalogue includes thousands of toolkits exposing tens of thousands of individual tools, including Slack, Notion, and WhatsApp. Breadth does not change the ownership rule. Each integration belongs to an authorized account rather than a master credential copied into every customer’s agent.
That breadth creates a separate problem inside the model’s context window. Loading GitHub and Notion as standard MCP tools produces roughly 70 tool schemas before the user’s first message, and expanding that approach to hundreds of apps becomes impractical. Composio’s meta-tool design reduces the exposed interface to seven discoverable meta-tools. This keeps tool discovery from consuming the context meant for the customer’s task.
The dependency still needs a failure plan. In April 2026, Composio experienced cumulative API degradation and an extended period when webhook triggers for several apps were unavailable. A cleanup job had stopped pruning a trigger-processing table.
The incident does not change the right credential model. Provisioning should bind an agent to the customer’s connected accounts, while the integration layer handles the tokens rather than exposing them as routine application work. The builder still defines which integrations the product permits. The customer grants access, and the credential service maintains the separation that a shared secret would erase.
What the CISA advisory and the OWASP checklist require of a provisioned agent’s security posture
CISA’s April 30, 2026 advisory, “Careful Adoption of Agentic AI Services,” brought agent deployment security into coordinated government guidance. CISA, the NSA, and the national cyber authorities of Australia, Canada, New Zealand, and the UK jointly published it. That gives buyers a concrete reference for security questions. It reinforces the need to design controls before an enterprise sale forces a retrofit.
The OWASP checklist turns broad concerns into three practical checks. Excessive functionality asks whether the agent has tools beyond its task, which provisioning can address through a tool allowlist scoped to the customer’s plan. Excessive permissions asks whether credentials let the agent do too much, which calls for per-user OAuth with minimal scope. Excessive autonomy asks whether high-risk actions can go ahead without human approval. Destructive tool calls therefore need approval workflows wired into the environment.
NVIDIA’s AI Red Team names indirect prompt injection as the main threat to AI coding agents that run tools with user-level permissions. Machine-readable, versioned policies should define the permitted tools, file paths, and network destinations at sandbox creation. Runtime middleware should check tool calls before they run and block actions that break those rules. The sandbox then contains a wrong action within the tenant’s environment rather than relying on the model to recognize every hostile instruction.
A policy states the boundary, runtime enforcement applies it, and isolation limits the reach of a failure. Prompt instructions can help with the workflow while other controls do the main work of keeping it safe. The provisioning call’s job is to install that posture consistently for every customer, so security does not depend on someone remembering a separate hardening step.
Claude Managed Agents keeps orchestration on Anthropic’s cloud and is not eligible for Zero Data Retention or a HIPAA BAA. Operators selling into regulated industries must evaluate that distinction when choosing the architecture. A runtime can provide useful operational controls and still be unsuitable for a particular buyer’s requirements. Those constraints belong in platform selection, before onboarding becomes a contractual promise.
How the webhook-first architecture holds as you scale from one customer to ten thousand
The obvious objection is that a single handler sounds like a startup shortcut. Surely thousands of customers need a different design? Not when the unit of scale is already one isolated, persistent agent per customer. Each environment contains its own agent state, while the application applies a common provisioning policy rather than accumulating bespoke deployment logic for every tenant.
At early scale, the handler fires once for each signup. At hundreds of customers, the same handler repeats while the managed platform handles concurrency, isolation, and uptime. At thousands, platforms designed for independent sandbox workloads can run many environments in parallel without an architectural change on the operator’s side. Capacity remains real work for the platform. As more customers join, the product team is spared new VPS configurations, monitoring scripts, and secrets rotation jobs.
The same pattern supports a white-label B2B product. Each client’s onboarding activates a private, persistent, branded agent without exposing the infrastructure or requiring the operator to hand-provision an account. Multi-tenant isolation is what lets one agent build serve many clients as a recurring product. Without that boundary, growth multiplies exceptions and shared-access risks. With it, onboarding remains a repeatable product event.
The limit of the claim is important. With a webhook, the team still has to deal with dependency failures, choose a platform, meet security obligations, and improve the agent itself. It puts routine provisioning and instance operations on the managed side of a clear boundary. The founder’s job is to sell and improve the agent, while the managed platform provisions, monitors, and recovers a separate instance for every new customer. The webhook is the line between those two jobs.


