Ship Your Customers an Agent
With Blocks, your support agent can ask your customer's agent for the evidence it needs, and the customer stays in control of what it shares.
Imagine this scenario: Hookline is a webhook API company, and Acme is one of its customers. Acme uses Hookline to receive payment events that take place in its billing system.
One day, every webhook Hookline sends to Acme starts failing.
Hookline see the errors straight away because their delivery logs fill up with 401 responses.
What Hookline can’t see is why, because the reason lives in Acme’s logs, on Acme’s servers. Acme can see the failures too, but not what changed on Hookline’s side. Each company has half of the answer.
Hookline’s support team asks Acme for its logs, then for a call. There’s back-and-forth, and it takes time.
I’ve been on the vendor side of that conversation many times, answering implementation questions in shared Slack channels at SendGrid and Zuplo. Typically, the fix was quick, but getting hold of the evidence was what took the time.
Wouldn’t it be great if we could be granted agentic access to data inside another company? Well, fortunately this is something that Blocks is perfect for so I got stuck in to see how it works.
At a basic level, this is a two agent scenario: Acme runs an agent next to its own logs. Hookline’s support agent asks it for what it needs. Acme decides what its agent is allowed to share, and it can turn that access off whenever it likes.
Blocks calls this kind of setup a partner network: agents in different companies working together, each one scoped and revocable by the company that owns it. Put simply, Hookline’s agent can work with Acme’s agent without either side opening a port, sharing keys or handing over data.
What is Blocks?
Blocks, by the folks at PubNub, is a network built for AI agents you already have. You build your agent however you like, and Blocks handles how it gets reached and who’s allowed to reach it.
- Connect. You add the Blocks SDK (TypeScript or Python) to your agent and use the CLI to register and run it. Your code lives in a handler that receives each request (a task) and returns the results (artifacts). The agent runs wherever it already lives and opens one outbound connection, so it needs no inbound ports or public endpoint.
- Register. The agent gets a name and an agent card describing what it does. It can then be called by name from a browser, the SDK, MCP tools like Claude Code, or other agents.
- Control access. New agents are private. You invite people or organizations, and you can revoke that access at any time. Each task tells your agent which user and organization it came from.
- Call other agents. Your agent can call any agent it has access to. Those calls are made as you, the agent’s owner.
The SDK and CLI offer lots of specific control but their out-of-the-box prompt for your harness of choice also works perfectly (if you’re already curious, just run that!).
One Agent Per Company
Each company has its own Blocks account and its own agent, built in different languages and running on different machines.
- Hookline’s agent reads Hookline’s delivery logs and a private runbook of known issues, and does the diagnosis.
- Acme’s agent runs next to Acme’s webhook logs and decides what is allowed to leave.
Hookline’s agent sends Acme’s agent the webhook endpoint and a time window. Acme’s agent sends back a short summary of the failing requests, never the raw logs. This ensures that only relevant information is being passed between the two agents and other, possibly sensitive, data stays where it is.
1 + 1 = Fixed
In the demo video above I show this failure as Hookline rotating its webhook signing secret and Acme never updates its config, which is a common way for webhooks to break.
Acting as a developer from Acme, I asked Hookline’s agent why my webhooks were failing. Within a few seconds it came back with the cause: the secret had been rotated, and Acme was still verifying with the old one. It got there by comparing a fingerprint of each side’s secret, which neither company could have done alone, and neither saw the other’s actual secret.
On Acme’s side, its agent logged who had asked and exactly what it had released. When Acme then revoked access, Hookline’s next request was refused, and its agent handed the ticket to a person.
The video shows the full run.
Make your security team happy
- Nothing new is exposed. Both agents connect outbound to Blocks. Acme doesn’t open a port, an endpoint or a VPN for Hookline.
- No credentials change hands. Each company uses its own Blocks account. Access is granted from one company to the other, without sharing any keys.
- The data owner decides what leaves. Acme’s release policy is plain code that Acme owns and can review. Payloads, headers and secrets stay on Acme’s side.
- Every request is attributable. Blocks verifies each request, and Acme’s agent knows which user and organization is asking.
- Access can be revoked. Acme can revoke the grant at any time, and the reason is recorded in the audit log.
Why this matters for you
If you build anything that connects to other people’s systems, you likely have to work through some version of this problem, and there are four steps I think you can apply.
1. Find the split
Each side holds something the other can’t see. In my demo, Hookline has its delivery logs and runbook, and Acme has its handler logs. If either side could answer the question alone, you don’t need two agents.
To broaden the examples, here are a few other places I’d expect to find the same split:
- An email delivery service and a customer whose emails are bouncing. The service has the bounce data, and the customer has their DNS and sending setup.
- A payments provider and a merchant whose payouts don’t reconcile. The provider has the settlement records, and the merchant has their order database.
- A developer tools vendor and a customer whose builds fail on private dependencies the vendor can’t access.
- Two teams inside the same company, where one owns data that might be restricted, and the other owns the expertise to diagnose an issue.
2. Keep the data under lock and key
The side with the sensitive data runs an agent right next to that data. I’d keep this agent simple, for speed and control.
The one I created doesn’t use an LLM at all, because I don’t want a model deciding what leaves someone’s network. Instead, it applies a release policy that restricts the fields returned, which is plain code:
# Release policy
MAX_WINDOW = timedelta(hours=24)
MAX_EVENTS = 20
RELEASED_FIELDS = ["ts", "event_id", "event_type", "http_status", "error"]
# The response also includes: the framework and SDK version, and a SHA-256 fingerprint of the configured secret.
# Not included: headers, payload, customer data, the secret itself.
To quickly explain the above, this is what’s happening:
- List the fields that are allowed out, rather than trying to list everything that isn’t.
- Limit the time window, so one request can’t pull everything.
- Send a fingerprint when you need to compare a sensitive value.
- Log who asked and what you sent back.
3. Reason where the expertise lives
The side with the expertise runs the agent that does the reasoning, and calls the other agent when it needs evidence. Every Blocks handler gets a ctx.taskClient for this:
const session = await ctx.taskClient.sendMessage({
agentName: 'acme_diagnostics',
requestParts: [{ partId: 'request', text: JSON.stringify({ endpoint, since }) }],
});
session.onArtifact((event) => { /* Acme's summary arrives here */ });
session.onTerminal((event) => { /* completed, failed or canceled */ });
Hookline doesn’t need a URL or an API key for Acme. It calls the agent by name. If Acme has revoked access, the call fails, so it’s worth catching that and handing over to a person.
Your “reasoning” might be an LLM with your docs and support history, or plain rules like mine. Either way, it stays on your side and only sees what the other agent chooses to send.
4. Include an off switch
Blocks agents are private when you register them, so each side grants the other access. In my demo, Acme lets Hookline call its agent, and Hookline lets Acme’s whole organization call its support agent (which is a nice support touch). That invite process can be done using the CLI, or via the web UI. Either way it’s simple.
# As Acme
blocks invite send acme_diagnostics --email <hookline-account-email>
# As Hookline
blocks invite send hookline_support --org <acme-org-slug>
Plan for revocation from the start. In a support scenario, access should end when the ticket closes, and it only takes one command to shut it down:
blocks invite revoke acme_diagnostics --email <hookline-account-email> --reason "Ticket closed"
What Blocks enabled
Without Blocks, connecting these two agents would have meant an inbound endpoint at Acme, a security review to open it, API keys managed between two companies, and a way to move log data and track who asked for it. This wouldn’t have saved any time and traditional back and forth would have won out.
On Blocks, it took two small agents, a release policy and one grant in each direction. The best part is that once it’s done, it’s there to use at any other time in future.
If your support team regularly asks customers for logs, this pattern is worth trying. Start by connecting an agent of your own with the quickstart, then make your first agent-to-agent call. If you want to see the whole demo running first, the repo has both agents and a setup guide.