<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: fcn06</title>
    <description>The latest articles on DEV Community by fcn06 (@fcn06).</description>
    <link>https://dev.to/fcn06</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4070178%2F49cf50bd-9c2a-40ed-a404-8ed0b8345aeb.png</url>
      <title>DEV Community: fcn06</title>
      <link>https://dev.to/fcn06</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fcn06"/>
    <language>en</language>
    <item>
      <title>What If the Enterprise API of the Future Is an Agent?</title>
      <dc:creator>fcn06</dc:creator>
      <pubDate>Mon, 31 Aug 2026 03:30:52 +0000</pubDate>
      <link>https://dev.to/fcn06/what-if-the-enterprise-api-of-the-future-is-an-agent-199p</link>
      <guid>https://dev.to/fcn06/what-if-the-enterprise-api-of-the-future-is-an-agent-199p</guid>
      <description>&lt;p&gt;We have been experimenting for some time with an architecture for secure AI agents, enterprise systems, messaging, identity, and controlled execution. This is an early, ongoing experiment, not a finished product — treat everything below, including the parts we've prototyped, accordingly. While working on it, we arrived at a thesis worth putting in front of people who think about integration and agent security for a living:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;APIs don't disappear. The enterprise boundary moves upward — from predefined technical interfaces toward negotiated, policy-constrained interaction contracts — with APIs and tools remaining the deterministic execution substrate underneath.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The goal isn't to replace APIs with LLMs. It's to reduce how much cross-enterprise integration logic must be agreed in advance, replacing some of it with governed runtime negotiation where that's safe. We currently call the software actor that carries out this negotiation on an enterprise's behalf a &lt;strong&gt;B2B agent&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The current model
&lt;/h2&gt;

&lt;p&gt;Today, enterprise integration usually looks like this: Company A writes an integration against Company B's API, which talks to Company B's business systems. Simple in shape, expensive in practice — Company B has to define REST endpoints, schemas, authentication, scopes, versioning, error models, webhooks, and SDKs, and Company A has to understand all of it before a single request can succeed.&lt;/p&gt;

&lt;p&gt;This works. But it also creates an enormous amount of integration work. Every company exposes slightly different models. Every pair of systems requires mapping. And even when two companies use the same protocol, they rarely use the same business semantics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agents change something important — but not the part people assume
&lt;/h2&gt;

&lt;p&gt;Agents are different from traditional applications because they can reason about intent. Instead of saying:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST /api/v3/orders
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;an agent can say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I want to order 500 units of product X, delivered in the EU before Friday. The maximum total price is €20,000.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's tempting to conclude that agents therefore replace APIs. We don't think that's quite right, and we don't think it's even the interesting claim. The API layer — &lt;code&gt;createOrder&lt;/code&gt;, &lt;code&gt;reserveInventory&lt;/code&gt;, &lt;code&gt;approvePayment&lt;/code&gt;, &lt;code&gt;cancelShipment&lt;/code&gt; — still needs to exist somewhere, deterministic and auditable, because that's what actually moves goods and money.&lt;/p&gt;

&lt;p&gt;What agents can plausibly remove is a &lt;em&gt;precondition&lt;/em&gt;: today, Company A has to understand Company B's native interface &lt;strong&gt;before&lt;/strong&gt; anything can happen. If agents can negotiate a shared, machine-readable description of the relationship at runtime, that precondition gets weaker. The API doesn't disappear — it moves one layer down, behind a negotiation and authorization layer:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwfvc55qudvgyl3u9lxls.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwfvc55qudvgyl3u9lxls.png" alt="Layered abstraction: business intent down to APIs as the execution substrate" width="800" height="1031"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A possible future interaction
&lt;/h2&gt;

&lt;p&gt;Imagine Company A's agent discovering Company B's B2B agent and saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I need access to quoting, ordering, order status, and cancellation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Company B's agent answers:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I support those capabilities. Orders may be cancelled until dispatch. Transactions above €10,000 require additional authorization. I only support EUR settlement for this relationship.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The two agents don't necessarily need identical native APIs. Instead, they negotiate an &lt;strong&gt;Interaction Contract&lt;/strong&gt; — a machine-readable definition of the relationship. A minimal illustration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;purpose&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;supplier_order_management&lt;/span&gt;

&lt;span class="na"&gt;capabilities&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;quote&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;create_order&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;order_status&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;cancel_order&lt;/span&gt;

&lt;span class="na"&gt;constraints&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;max_order_value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;currency&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;EUR&lt;/span&gt;
    &lt;span class="na"&gt;amount&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10000&lt;/span&gt;

&lt;span class="na"&gt;geography&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;EU&lt;/span&gt;

&lt;span class="na"&gt;cancellation&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;allowed_until&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dispatch&lt;/span&gt;

&lt;span class="na"&gt;validity&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;expires_in&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;30_days&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A skeptical reader might reasonably ask: &lt;em&gt;isn't this just OAuth scopes plus a JSON Schema plus a policy engine?&lt;/em&gt; Fair question. What we think makes an Interaction Contract a distinct artifact, rather than a fancy permission set, is that it's meant to bind several dimensions together at once — counterparties and identity requirements, permitted business purposes, capabilities, agreed semantics, constraints, data policy, required workflow ordering, delegation rights, obligations (SLAs, confirmations), validity, revocation, and attestation — as one versioned, signed, hashable object. That's closer to a &lt;strong&gt;machine-enforceable operational relationship&lt;/strong&gt; than a scope list.&lt;/p&gt;

&lt;p&gt;One clarification worth stating plainly: "Interaction Contract" here means a machine-enforceable &lt;em&gt;technical&lt;/em&gt; agreement between two software actors, not a legally binding commercial contract — although the two concepts may eventually need to intersect, particularly once commercial terms are involved.&lt;/p&gt;

&lt;p&gt;We're also not fully settled on whether an Interaction Contract is best modeled as one object or as an envelope over several independently versioned artifacts — identity assertions, capability agreement, semantic mapping, policy constraints, delegation constraints, obligations, and attestations. The semantic mapping, for instance, may need to change on its own timeline while the rest of the relationship stays fixed. We don't think this needs to be resolved for the argument to hold, but it's likely to matter once this moves past a prototype.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this sits relative to MCP and A2A
&lt;/h2&gt;

&lt;p&gt;Anyone following this space will reasonably ask whether this is just reinventing A2A. It isn't, and we want to be explicit about why, because we'd rather be complementary to existing protocols than start a standards fight we don't need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At its core, &lt;strong&gt;MCP&lt;/strong&gt; standardizes agent/tool and resource interaction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A2A&lt;/strong&gt; provides &lt;em&gt;agent ↔ agent&lt;/em&gt; interoperability — discovery, capabilities, task exchange between agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interaction Contract&lt;/strong&gt; governs the &lt;em&gt;enterprise ↔ enterprise relationship&lt;/em&gt; those agents are allowed to establish — the negotiated scope, constraints, and semantics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trust Gateway&lt;/strong&gt; is the policy decision and execution-authorization layer sitting behind each side.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ExecutionGrant&lt;/strong&gt; is the per-operation authority actually handed to an executor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Put differently: assume A2A solves communication and interoperability between agents. Our question is what governs the &lt;em&gt;relationship&lt;/em&gt; the two agents are allowed to establish, and what stops either side from acting outside it.&lt;/p&gt;

&lt;p&gt;There are adjacent standards and ideas here that solve important parts of this problem already. OAuth Rich Authorization Requests (RAR) provides a way to express fine-grained, transaction-specific authorization rather than relying only on coarse scopes. AuthZEN standardizes interaction between policy enforcement and policy decision points. MCP addresses tool and resource interoperability, while A2A addresses interoperability between agents.&lt;/p&gt;

&lt;p&gt;We're not proposing replacements for those. The hypothesis is about the layer that composes identity, negotiated business semantics, relationship constraints, delegation, and operation-level authorization into a governed cross-enterprise interaction. In that model, existing standards can provide much of the machinery underneath rather than being displaced by it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agents propose. Gateway decides. Executors verify.
&lt;/h2&gt;

&lt;p&gt;This is the load-bearing sentence in the whole design, and probably more important than the "B2B agent" framing itself. We don't think two LLMs should negotiate something and then simply execute it — that would be far too dangerous. The architecture deliberately separates &lt;strong&gt;reasoning&lt;/strong&gt;, &lt;strong&gt;authority&lt;/strong&gt;, and &lt;strong&gt;execution&lt;/strong&gt; into different actors:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F96cpucr48fwy4y1ynq6l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F96cpucr48fwy4y1ynq6l.png" alt="Company A and Company B: agent, trust gateway, and executor on each side, connected by A2A and an Interaction Contract" width="800" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The agent doesn't hold final execution authority. A separate Trust Gateway control plane evaluates policy and issues short-lived cryptographic execution grants; an executor performs the actual side effect only after verifying that grant.&lt;/p&gt;

&lt;p&gt;Here's a property we think deserves a name of its own. Between "what was authorized" and "what actually executes," there's a window where the two can diverge — an authorized &lt;code&gt;transfer(account=A, amount=100)&lt;/code&gt; becoming an executed &lt;code&gt;transfer(account=B, amount=10000)&lt;/code&gt;. It's structurally the same shape as a classic &lt;strong&gt;TOCTOU (time-of-check-to-time-of-use) bug&lt;/strong&gt;, just at the agent-action layer instead of the filesystem layer. In our prototype, execution grants are short-lived and single-purpose, and execution authorization is cryptographically bound to the specific tool and the exact canonical arguments via an &lt;code&gt;input_hash&lt;/code&gt;, so a grant is only valid for the precise action it was issued for — not "an action like this one." (Preventing reuse of the same grant across distributed executors is part of the design goal; we're not yet claiming that guarantee is airtight in every deployment topology.) That's one of the security properties we consider important enough not to bury in a longer capability list — alongside delegation, revocation, and distributed policy state, which matter just as much and which we haven't fully covered here.&lt;/p&gt;

&lt;p&gt;So the model isn't "agent executes anything." It's: agent proposes intent → Interaction Contract constrains the relationship → Trust Gateway applies deterministic policy → a cryptographically bound ExecutionGrant → executor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agents negotiate meaning, not authority
&lt;/h2&gt;

&lt;p&gt;In our hypothesis, the agent negotiates business intent, compatible capabilities, schema mappings, data requirements, transaction constraints, workflow expectations, and delivery semantics. It should never decide whether an enterprise action is authorized — that stays deterministic. More precisely: agents may negotiate the shape of a proposed permission envelope, but they cannot confer authority that the enterprise hasn't independently delegated.&lt;/p&gt;

&lt;p&gt;Two agents might negotiate a maximum transaction of €50,000, but if enterprise policy caps it at €10,000, €10,000 should win:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;effective authority =
    negotiated contract
    ∩ enterprise policy
    ∩ identity authority
    ∩ delegated authority
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A negotiated agreement can only make the permitted space smaller. It should never be able to create new authority — though as we note below, even this formula isn't the whole story once multiple contracts combine.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we've prototyped so far
&lt;/h2&gt;

&lt;p&gt;This isn't purely theoretical, but it's still early, and only a slice of it is public: a portion of the underlying execution-control-plane concepts is open source; most of the current build is private and iterating quickly. Treat the open-source repository as the visible tip of an experiment still taking shape, not the full system.&lt;/p&gt;

&lt;p&gt;Concretely, we've implemented the negotiation lifecycle (discover, propose, counter-propose, accept, attest) as working code, and the authorization path: the Trust Gateway verifies canonical terms hashes, counterparty identity, monetary limits, and geographic constraints, and stamps a &lt;code&gt;contract_id&lt;/code&gt; and &lt;code&gt;contract_hash&lt;/code&gt; into every execution grant issued under that agreement. That gives a provenance chain from &lt;em&gt;what did these two agents agree&lt;/em&gt; to &lt;em&gt;what exact operation actually happened&lt;/em&gt; — identity, contract, policy, and input hash all feed into the grant, which feeds into the execution result. This is the target behavior we're validating, not a claim that it's proven at production scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  The harder problem may be semantic, not cryptographic
&lt;/h2&gt;

&lt;p&gt;OAuth, PKI, signing, and grant verification at least give us mature primitives to work with — that doesn't mean enterprise deployment (key custody, federation, revocation, lifecycle) is easy, just that the building blocks exist. The harder unresolved problem in this architecture is closer to: what does &lt;code&gt;cancel_order&lt;/code&gt; mean to Company A versus Company B? "Cancel" for A might mean &lt;em&gt;void the PO outright if unshipped&lt;/em&gt;; for B it might mean &lt;em&gt;file a cancellation request subject to supplier approval&lt;/em&gt;. Two agents can linguistically convince each other those concepts match without them actually matching — a kind of &lt;strong&gt;semantic false agreement&lt;/strong&gt; that's more dangerous than an outright rejection, because it fails silently.&lt;/p&gt;

&lt;p&gt;We suspect the safer pattern is not "the LLM invents a mapping and we trust it," but something closer to: agent proposes a mapping → the mapping is captured as a deterministic, versioned artifact → schema and policy validation → optional human or certification approval → the mapping is hashed and versioned → future executions reference the approved mapping, not a fresh inference. In other words, use AI to generate interoperability artifacts, not to &lt;em&gt;be&lt;/em&gt; the interoperability artifact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this could change integration
&lt;/h2&gt;

&lt;p&gt;We've spent enormous effort standardizing application interfaces — REST, OpenAPI, OAuth, and now MCP and A2A. Our hypothesis is that the long-term abstraction sits one layer higher: instead of requiring every company to expose the same business API, we standardize the protocol for discovering capabilities and negotiating interactions, while the API layer keeps doing the deterministic work underneath. We'd still need standards — arguably more than ever, for identity, capability discovery, authorization, delegation, revocation, and audit — just not the same application-level interface from every company.&lt;/p&gt;

&lt;h2&gt;
  
  
  A brief note on interfaces beyond APIs
&lt;/h2&gt;

&lt;p&gt;The same model may eventually extend to human-facing commerce, where a user's agent negotiates directly with a merchant's agent under delegated authority. That's a separate topic, though, and probably deserves its own article.&lt;/p&gt;

&lt;h2&gt;
  
  
  There are still many hard questions
&lt;/h2&gt;

&lt;p&gt;This is a work in progress, and the open questions probably outnumber the answers so far:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much should agents really negotiate?&lt;/strong&gt; Free-form negotiation is tempting but probably a mistake; negotiation likely needs to happen inside well-defined capability and policy boundaries, not from a blank slate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Composition and cumulative authority.&lt;/strong&gt; Authorization can't always be evaluated one action at a time. Individually safe grants can become unsafe together — read access to a catalog, permission to submit a purchasing recommendation, and permission to send an external message might each be fine alone and risky combined. Evaluating &lt;code&gt;contract ∩ policy ∩ identity ∩ delegation&lt;/code&gt; may also require transaction history, cumulative spend, velocity limits, and separation of duties — which likely means the Trust Gateway needs stateful authorization, not a static per-request check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transaction and failure semantics.&lt;/strong&gt; Negotiating intent is only part of the problem. An order gets created, inventory reservation fails, payment authorization already succeeded, and the network response never arrives — now what? Cross-enterprise actions still need deterministic treatment of retries, idempotency, partial failure, compensation, reconciliation, and disputed outcomes. Agents don't make any of that go away.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Discovery trust.&lt;/strong&gt; How does Company A know it discovered the &lt;em&gt;real&lt;/em&gt; Company B agent, and not an impersonation? Discovery is only useful if the counterparty's endpoint, organization, capabilities, and credentials can be authenticated and kept current — which points back to identity infrastructure, not just negotiation logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How should contracts be signed?&lt;/strong&gt; DID-based signatures are one option, traditional enterprise PKI another — in many environments, both may need to coexist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does human approval fit?&lt;/strong&gt; Some contracts could be automatic. Others should require approval when a new counterparty is involved, financial limits are high, new data categories are exposed, new jurisdictions are involved, or sensitive capabilities are requested.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where does payment fit?&lt;/strong&gt; Once an Interaction Contract includes commercial terms and not just capabilities and permissions, it starts looking like a machine-readable commercial agreement — which is exactly why we're careful to distinguish it from a legal contract above.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we think this is worth exploring
&lt;/h2&gt;

&lt;p&gt;We don't know whether this exact architecture will become the future of enterprise integration. But we increasingly believe something structurally similar will emerge. Agents are becoming first-class software actors with identities, delegated authority, and increasingly consequential permissions. They are beginning to discover other agents and capabilities, and are likely to initiate increasingly consequential transactions. Once that happens, enterprises will need a controlled interface between the probabilistic agent world and deterministic business systems.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Agents negotiate. Contracts capture agreement. Gateways authorize. Executors execute.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the direction we're experimenting with.&lt;/p&gt;




&lt;h2&gt;
  
  
  We'd like your feedback
&lt;/h2&gt;

&lt;p&gt;We'd be especially interested in hearing from people working on MCP, A2A, agent identity, API gateways, authorization, payments, B2B integration, autonomous commerce, or zero-trust agent architectures. Three questions we're genuinely unsure about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The negotiation boundary:&lt;/strong&gt; which parts of a B2B integration could safely be negotiated at runtime, and which must stay predefined?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The trust boundary:&lt;/strong&gt; is "agents propose, gateways authorize, executors verify" the right separation of responsibilities — or does it introduce a layer you wouldn't actually want?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The semantic boundary:&lt;/strong&gt; can business semantics ever be safely negotiated dynamically, or will enterprises always need certified canonical models for anything consequential?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Comments here are the easiest way to reach us. If you spend five minutes poking holes in this, we'll read every one of them.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>api</category>
      <category>security</category>
    </item>
    <item>
      <title>Stop Giving AI Agents Your Master Password: UCAN Delegation</title>
      <dc:creator>fcn06</dc:creator>
      <pubDate>Sun, 23 Aug 2026 08:02:16 +0000</pubDate>
      <link>https://dev.to/fcn06/stop-giving-ai-agents-your-master-password-a-plain-english-guide-to-ucan-delegation-5ef3</link>
      <guid>https://dev.to/fcn06/stop-giving-ai-agents-your-master-password-a-plain-english-guide-to-ucan-delegation-5ef3</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Why handing a permanent API key to an autonomous AI agent is a bad idea — and a simpler way to grant it just enough trust, for just long enough, using cryptographic "visas" called UCANs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Status: work in progress.&lt;/strong&gt; This is an early write-up of something I'm actively building, not a finished product announcement. I'm sharing it specifically to get feedback — on the idea, the explanation, and the approach itself — before taking it further. See the last section for exactly what kind of feedback would help most.&lt;/p&gt;




&lt;h2&gt;
  
  
  The problem, in one picture
&lt;/h2&gt;

&lt;p&gt;Imagine you hire an intern to add one meeting to your Google Calendar. Would you hand them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A)&lt;/strong&gt; Your Google password — which also opens your email, your Drive, and your saved credit cards, or&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;B)&lt;/strong&gt; A note that says &lt;em&gt;"You may add one event, today, between 2 and 4 PM. Nothing else."&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everyone picks B for a human intern. Almost nobody picks B for an AI agent.&lt;/p&gt;

&lt;p&gt;Today, most AI agent frameworks (LangChain, CrewAI, AutoGen, and friends) are wired up with &lt;strong&gt;Option A&lt;/strong&gt;: a permanent, all-powerful API key pasted straight into the agent's code or environment variables. If that agent gets tricked by a malicious webpage, hallucinates, or simply has a bug, it doesn't just fail — it fails &lt;em&gt;with full permissions&lt;/em&gt;. Wiped databases and drained accounts are not hypothetical; they're a Tuesday.&lt;/p&gt;

&lt;p&gt;The obvious fix — "just ask the human before every single click" — kills the entire point of having an autonomous agent. Nobody wants to approve every calendar invite by hand.&lt;/p&gt;

&lt;p&gt;We wanted a third option: agents that can act on their own, but only within a narrow, time-boxed, cryptographically provable slice of permission. That's what this article walks through.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuidu45tk65zs83xqgoeq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuidu45tk65zs83xqgoeq.png" alt=" " width="800" height="666"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The idea: give agents a passport, not a master key
&lt;/h2&gt;

&lt;p&gt;Think about how &lt;em&gt;you&lt;/em&gt; cross a border. You don't hand a customs officer your entire identity and bank access — you hand them a &lt;strong&gt;passport&lt;/strong&gt;, and inside it, a &lt;strong&gt;visa&lt;/strong&gt; that says exactly which country you can enter, for how long, and for what purpose.&lt;/p&gt;

&lt;p&gt;We apply the same idea to AI agents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;UCAN&lt;/strong&gt; (User Controlled Authorization Network) is the digital equivalent of a visa: a small, signed piece of proof that says &lt;em&gt;"person X allows agent Y to do Z, until this time."&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;Virtual Passport&lt;/strong&gt; is the little folder an agent carries around, holding all the UCANs (visas) it has been issued by different people or departments.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ┌──────────────────────────────────────────────────────────┐
 │                AGENT'S VIRTUAL PASSPORT                  │
 │  Agent: "Supervisor Agent #7721"                          │
 │                                                            │
 │  🎫 Visa #1 — issued by Alice                              │
 │     Allowed: create a Google Calendar event                │
 │     Valid for: 10 minutes                                  │
 │                                                            │
 │  🎫 Visa #2 — issued by Finance                            │
 │     Allowed: approve refunds up to $50                     │
 │     Valid for: 1 hour                                      │
 └──────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each visa is signed with real cryptography (Ed25519 signatures), so nobody can forge one or quietly extend its lifetime. Under the hood, a UCAN is just a small, signed JSON object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"issuer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"did:twin:alice..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"audience"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"did:twin:supervisor-agent..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"capabilities"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"google_calendar"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"create_event"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"expiry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1787491200&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;issuer&lt;/strong&gt; — who is granting the permission (Alice)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;audience&lt;/strong&gt; — who receives it (the agent)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;capabilities&lt;/strong&gt; — exactly what the agent may do, nothing more&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;expiry&lt;/strong&gt; — the moment this visa stops working, automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No central authority has to revoke anything — the token simply stops being valid. That's the whole trick.&lt;/p&gt;




&lt;h2&gt;
  
  
  A narrower visa for a narrower job: delegation
&lt;/h2&gt;

&lt;p&gt;Here's the part that makes this genuinely useful for multi-agent systems, not just a single bot: &lt;strong&gt;an agent can hand a smaller visa to another agent.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Say Alice asks her "Supervisor" agent to schedule a client meeting. The Supervisor spins up a small "Worker" agent just to touch the calendar. It doesn't hand the Worker its &lt;em&gt;own&lt;/em&gt; visa (which might also include refund permissions) — it mints a &lt;strong&gt;new, narrower visa&lt;/strong&gt;, stripped down to exactly &lt;code&gt;calendar: create_event&lt;/code&gt;, and nothing else.&lt;/p&gt;

&lt;p&gt;This is called &lt;strong&gt;attenuation&lt;/strong&gt;: every time permission is delegated, it can only get &lt;em&gt;narrower&lt;/em&gt;, never wider. A worker agent can never end up with more power than its supervisor had. That single rule is what makes it safe to build swarms of agents that spawn other agents without the whole thing turning into a permissions free-for-all.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqxn3wp0ywun6tl730rps.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqxn3wp0ywun6tl730rps.png" alt=" " width="800" height="306"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What actually happens when the agent tries to act
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7h3esgs9sv0hv4oumwym.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7h3esgs9sv0hv4oumwym.png" alt=" " width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Two things are worth noticing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The agent never talks to Google Calendar directly with a permanent credential.&lt;/strong&gt; It shows its visa to a middleman — the &lt;strong&gt;Trust Gateway&lt;/strong&gt; — which checks that everything is legitimate and in-scope, then issues a tiny, single-use pass valid for just 30 seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;That 30-second pass is also cryptographically tied to the exact action requested&lt;/strong&gt; (the specific meeting title and time, hashed). Even if it leaked, it couldn't be replayed or repurposed for a different action.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If an agent ever tries to do something &lt;em&gt;outside&lt;/em&gt; what its visa allows — say, a $500 refund when it only has a $50 visa — the request doesn't fail silently or get approved anyway. It gets parked and sent to the human for a real approval (a fingerprint or Face ID tap on their phone), before anything happens.&lt;/p&gt;

&lt;p&gt;So the agent gets to act autonomously &lt;em&gt;within its lane&lt;/em&gt;, and a human only gets pulled in when something falls outside that lane. That's the balance the "God-mode key vs. approve-everything" dilemma from the start of this article was missing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Trying it yourself
&lt;/h2&gt;

&lt;p&gt;The gateway that does the checking — the &lt;strong&gt;Trust Gateway&lt;/strong&gt; — is open source and written in Rust. Here's the shortest possible version of the flow above, using its API directly. All three calls below are handled entirely inside the open-source &lt;code&gt;trust_gateway&lt;/code&gt; itself — no other service is involved in minting, validating, or checking policy on a token.&lt;/p&gt;

&lt;p&gt;Swap in your own gateway's address wherever you see &lt;code&gt;&amp;lt;YOUR-TRUST-GATEWAY-URL&amp;gt;&lt;/code&gt; (e.g. &lt;code&gt;http://127.0.0.1:3060&lt;/code&gt; if you're running it locally).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Alice mints a visa for her agent&lt;/strong&gt;, scoped to calendar access only, for one hour:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://&amp;lt;YOUR-TRUST-GATEWAY-URL&amp;gt;/v1/ucan/mint &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "issuer": "did:twin:alice...",
    "audience": "did:twin:supervisor-agent...",
    "capabilities": [{ "resource": "google_calendar", "action": "create_event" }],
    "ttl_seconds": 3600,
    "issuer_seed_hex": "&amp;lt;alice_private_seed&amp;gt;"
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This returns a signed UCAN token — the digital visa.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Anyone can verify that visa, without contacting Alice&lt;/strong&gt;, because the proof is self-contained:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://&amp;lt;YOUR-TRUST-GATEWAY-URL&amp;gt;/v1/ucan/validate &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "ucan_token": "&amp;lt;the token from step 1&amp;gt;",
    "required_resource": "google_calendar",
    "required_action": "create_event"
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. The agent proposes the actual action.&lt;/strong&gt; The Gateway checks the visa and, if everything lines up, mints the short-lived execution pass:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://&amp;lt;YOUR-TRUST-GATEWAY-URL&amp;gt;/v1/actions/propose &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "action_name": "google_calendar_create_event",
    "arguments": {
      "summary": "Architecture Review",
      "start_time": "2026-09-01T14:00:00Z"
    },
    "ucan_token": "&amp;lt;the token from step 1&amp;gt;"
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it — three calls, entirely served by the open-source gateway, and you've reproduced the whole "mint a scoped permission, verify it, use it once" cycle. The full API also lets an agent prove it holds &lt;em&gt;one&lt;/em&gt; specific capability without revealing the rest of its passport (handy if it's carrying visas it shouldn't disclose), and lets you inspect an agent's live passport at any time. Both are just extensions of the same idea. Turning that final execution pass into a real side effect (actually touching Google Calendar) is the one piece that needs something outside the gateway — a downstream tool consumer to carry it out — but the entire token lifecycle and governance you just exercised runs on &lt;code&gt;trust_gateway&lt;/code&gt; alone.&lt;/p&gt;




&lt;h2&gt;
  
  
  Open source
&lt;/h2&gt;

&lt;p&gt;Everything described in this article — UCAN minting and validation, delegation, and execution-grant issuance — lives in the open-source Trust Gateway, written in Rust and runnable locally today:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://github.com/fcn06/trust_gateway" rel="noopener noreferrer"&gt;github.com/fcn06/trust_gateway&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Don't hand AI agents permanent, all-powerful API keys.&lt;/strong&gt; It's the equivalent of giving an intern your master password.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give them a passport of short-lived, narrowly scoped visas instead&lt;/strong&gt; — cryptographically signed, automatically expiring, and impossible to widen through delegation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check every action at the door&lt;/strong&gt;, with a lightweight gateway that turns a valid visa into a single-use, single-action execution pass.
The agent still acts on its own. It just can't act beyond what it was actually trusted to do — and that trust is provable, not just assumed.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  I'd like your feedback
&lt;/h2&gt;

&lt;p&gt;This is still a work in progress, and I'd genuinely like to hear from people who read this — whether you build agents, work in security, or just have an opinion. A few specific things I'm unsure about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The core idea:&lt;/strong&gt; Does scoping AI agent permissions with short-lived, delegatable visas (UCANs) actually solve a problem you've run into, or does it feel like overkill for how you use agents today?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The explanation:&lt;/strong&gt; Was the passport/visa analogy clear, or did it break down somewhere once the delegation and execution-grant parts came in?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The gaps:&lt;/strong&gt; What's missing that would make you trust this in production — key rotation, revocation before expiry, auditability, something else?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The demo:&lt;/strong&gt; If you tried the three &lt;code&gt;curl&lt;/code&gt; calls yourself, did they work as described? Anything confusing about the request/response shapes?
Comments here are the easiest way to reach me, but I'll also take issues or pull requests on the &lt;a href="https://github.com/fcn06/trust_gateway" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt;. If you spend five minutes poking holes in this, I'll read every one of them.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>humanintheloop</category>
      <category>virtualpassport</category>
      <category>agents</category>
    </item>
    <item>
      <title>You Don't Need to Choose Between a Gateway and an Agent Framework</title>
      <dc:creator>fcn06</dc:creator>
      <pubDate>Fri, 21 Aug 2026 15:32:51 +0000</pubDate>
      <link>https://dev.to/fcn06/you-dont-need-to-choose-between-a-gateway-and-an-agent-framework-2gma</link>
      <guid>https://dev.to/fcn06/you-dont-need-to-choose-between-a-gateway-and-an-agent-framework-2gma</guid>
      <description>&lt;p&gt;When I first published &lt;a href="https://github.com/fcn06/swarm" rel="noopener noreferrer"&gt;Swarm&lt;/a&gt; on GitHub, most questions weren't about Rust or MCP. They were about timing and categorization:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"We just need a lightweight gateway for multi-provider routing; agents feel like overkill."&lt;/p&gt;

&lt;p&gt;"We already run an orchestration framework; why would we replace our proxy?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This reaction highlights a false dichotomy currently plaguing the AI infrastructure ecosystem: the assumption that a gateway and an agent orchestrator must be two completely different products.&lt;/p&gt;

&lt;p&gt;In practice, teams rarely wake up needing full-blown multi-agent autonomous swarms on Day 1. But when they start with a standalone proxy, they inevitably hit a wall — patching together Python microservices, external vector state stores, MCP bridges, and ad-hoc eval scripts. Every evolution requires a rewrite.&lt;/p&gt;

&lt;p&gt;The core premise of Swarm is different: a single, pure-Rust runtime where you don't choose between a gateway and an orchestrator — you simply choose which capabilities to turn on.&lt;/p&gt;




&lt;h2&gt;
  
  
  The AI Adoption Ladder
&lt;/h2&gt;

&lt;p&gt;Most engineering teams evolve their LLM stack along a predictable trajectory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Rung 1: OpenAI-Compatible Gateway   (Drop-in replacement for hardcoded SDKs)
  └── Rung 2: Multi-Provider Fallbacks (Groq, Gemini, Ollama, vLLM via TOML)
        └── Rung 3: Stateful Sessions     (Previous response chaining &amp;amp; context)
              └── Rung 4: Native MCP Tools    (SSE + Streamable HTTP tool execution)
                    └── Rung 5: Multi-Agent DAGs  (Planner + Executor + Specialists)
                          └── Rung 6: Built-in Evals    (LLM-as-a-Judge &amp;amp; policy gates)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can stop at any rung and have a lean, production-grade binary. When you're ready for the next level, you change a configuration flag — not your architectural foundation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rung 1 — Just a Low-Latency Gateway
&lt;/h2&gt;

&lt;p&gt;If your immediate goal is simply eliminating hardcoded API keys and single-vendor SDK locks, Swarm acts as an OpenAI-compatible drop-in front door with sub-millisecond native routing overhead.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Spin up the gateway in seconds&lt;/span&gt;
./kickstart/gateway_kickstart/01_launch_gateway.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST http://localhost:8080/v1/chat/completions &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "model": "openai/gpt-4o-mini",
    "messages": [{"role": "user", "content": "Explain progressive disclosure in software."}]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You get instant OpenAI compatibility. No agent overhead, no background worker queues, no forced abstractions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rung 2 — Multi-Provider &amp;amp; Local Model Routing
&lt;/h2&gt;

&lt;p&gt;When rate limits hit or you need cost-effective fallbacks across cloud and local runtimes (Groq, Anthropic, Gemini, Ollama, vLLM, llama.cpp), routing is declared cleanly in &lt;code&gt;config.toml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[providers.groq]&lt;/span&gt;
&lt;span class="py"&gt;api_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://api.groq.com/openai/v1/chat/completions"&lt;/span&gt;
&lt;span class="py"&gt;weight&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;

&lt;span class="nn"&gt;[providers.local_vllm]&lt;/span&gt;
&lt;span class="py"&gt;api_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"http://localhost:8000/v1/chat/completions"&lt;/span&gt;
&lt;span class="py"&gt;recommended_models&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"meta-llama/Llama-3.3-70B-Instruct"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your applications continue calling the same &lt;code&gt;/v1/chat/completions&lt;/code&gt; endpoint. Failover, load distribution, and local-inference routing happen invisibly inside the runtime.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rung 3 — Stateful Conversations via &lt;code&gt;/v1/responses&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Multi-turn chat state is where teams often bolt on an external Redis or PostgreSQL session manager. Swarm provides explicit turn-by-turn state management natively through &lt;code&gt;/v1/responses&lt;/code&gt; using &lt;code&gt;previous_response_id&lt;/code&gt; chaining:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST http://localhost:8080/v1/responses &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "model": "groq/llama-3.3-70b-versatile",
    "input": "Calculate the Q3 cloud infrastructure spend.",
    "previous_response_id": "resp_01JMW892KPA7XYZ"
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;State is managed by the runtime, eliminating client-side conversation bloat while keeping state inspection simple and deterministic.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rung 4 — Native Model Context Protocol (MCP)
&lt;/h2&gt;

&lt;p&gt;When your model needs real-world context — database schemas, filesystem access, API calls — you shouldn't have to migrate to a heavy agent framework just to call tools.&lt;/p&gt;

&lt;p&gt;Swarm natively supports MCP (over both SSE and streamable HTTP) directly inside the gateway layer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[mcp_servers.postgres_db]&lt;/span&gt;
&lt;span class="py"&gt;transport&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"sse"&lt;/span&gt;
&lt;span class="py"&gt;url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"http://localhost:3001/sse"&lt;/span&gt;

&lt;span class="nn"&gt;[mcp_servers.git_tools]&lt;/span&gt;
&lt;span class="py"&gt;transport&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"http"&lt;/span&gt;
&lt;span class="py"&gt;url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"http://localhost:3002/mcp"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tool discovery, argument validation, and streaming tool execution run within the same engine that routes your completions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rung 5 — Coordinated Multi-Agent Workflows
&lt;/h2&gt;

&lt;p&gt;When single-prompt loops cannot solve compound tasks, Swarm activates its autonomous orchestration engine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Intent
   │
   ▼
[ Planner ] ──► Builds Execution DAG (Dependencies &amp;amp; Concurrency)
   │
   ▼
[ Executor ] ──► Dispatches tasks across Domain Specialists
   │
   ├── Specialist A (Data Analyst + Postgres MCP)
   └── Specialist B (Report Writer + File MCP)
   │
   ▼
Unified Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why this matters:&lt;/strong&gt; Rung 5 reuses the identical provider configurations, fallback pools, state engine, and MCP tool connectors established in Rungs 1–4. There is no secondary agent daemon or translation bridge.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rung 6 — Built-in LLM-as-a-Judge Evaluation
&lt;/h2&gt;

&lt;p&gt;The final rung is the one most gateways and agent frameworks omit entirely: closing the loop on quality.&lt;/p&gt;

&lt;p&gt;Instead of exporting logs to an external SaaS pipeline, Swarm embeds an LLM-as-a-Judge loop. It scores intermediate DAG outputs, validates MCP tool results against deterministic schemas, and flags hallucinated responses before they reach client applications:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST http://localhost:8080/v1/eval/judge &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "response_id": "resp_01JMW892KPA7XYZ",
    "criteria": ["correctness", "grounding", "conciseness"],
    "judge_model": "openai/gpt-4o"
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This foundational layer enables our upcoming roadmap items: policy-based dynamic routing, durable state checkpoints, and human-in-the-loop validation gates.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architectural Coherence Beats Glue Code
&lt;/h2&gt;

&lt;p&gt;The individual capabilities of Swarm — gateway proxying, MCP tool invocation, DAG planning, automated evaluation — exist across different open-source projects.&lt;/p&gt;

&lt;p&gt;What is rare is finding them integrated into a single, zero-dependency, memory-safe binary where adopting multi-agent orchestration doesn't invalidate the proxy architecture you set up on Day 1.&lt;/p&gt;

&lt;p&gt;The architectural bet of Swarm is simple: &lt;strong&gt;the tools you choose when you only need a gateway should never become technical debt the day you need agents.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Discussion
&lt;/h2&gt;

&lt;p&gt;If you're currently scaling your LLM infrastructure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At which rung on this ladder has your team spent the most engineering time?&lt;/li&gt;
&lt;li&gt;Have you had to replace a gateway when moving to agents (or vice-versa)?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out the project and try the kickstart scripts on GitHub: &lt;strong&gt;&lt;a href="https://github.com/fcn06/swarm" rel="noopener noreferrer"&gt;github.com/fcn06/swarm&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>llm</category>
      <category>mcp</category>
      <category>ai</category>
      <category>multiagent</category>
    </item>
    <item>
      <title>Introducing Swarm: Multi-Agent Orchestration and an LLM Gateway in Pure Rust 🦀</title>
      <dc:creator>fcn06</dc:creator>
      <pubDate>Tue, 18 Aug 2026 05:48:26 +0000</pubDate>
      <link>https://dev.to/fcn06/introducing-swarm-multi-agent-orchestration-and-an-llm-gateway-in-pure-rust-54ha</link>
      <guid>https://dev.to/fcn06/introducing-swarm-multi-agent-orchestration-and-an-llm-gateway-in-pure-rust-54ha</guid>
      <description>&lt;p&gt;While experimenting with multi-agent systems, I kept ending up with two separate pieces of infrastructure: an orchestration layer for agents and tools, and a gateway layer for routing LLM requests.&lt;/p&gt;

&lt;p&gt;I wanted both to share the same runtime, provider abstractions, state management, and protocol contracts.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://github.com/fcn06/swarm" rel="noopener noreferrer"&gt;Swarm&lt;/a&gt;&lt;/strong&gt;, an open-source AI orchestration framework and model gateway written in Rust.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Dual-Mode Architecture
&lt;/h2&gt;

&lt;p&gt;Many AI stacks end up separating these concerns: a dedicated proxy for lightweight routing and a separate orchestrator for more complex reasoning. Swarm unifies both patterns around a single high-performance Tokio runtime.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+--------------------------------------------------------------------------------------------------+
|                                        SWARM MODES                                               |
+--------------------------------------------------------------------------------------------------+
|                                                                                                  |
|   MODE 1: MULTI-AGENT &amp;amp; MCP ORCHESTRATION               MODE 2: MODEL GATEWAY SERVER             |
|   (kickstart/multi_agent_orchestration_kickstart/)      (kickstart/gateway_kickstart/)           |
|                                                                                                  |
|   • Planner Agent (Dynamic plan generation)             • POST /v1/chat/completions (OpenAI)     |
|   • Executor Agent (Workflow DAG execution)             • POST /v1/responses (Open Responses)    |
|   • Domain Specialists with MCP Tool integration        • Stateful multi-turn chaining          |
|   • Discovery &amp;amp; Memory services                         • Multi-provider (Groq, Gemini, OpenAI,  |
|   • Evaluation &amp;amp; Judge Service                            Ollama / vLLM / local endpoints)       |
|   • Resilient OAuth2 / JWT authentication               • High-throughput lock-free cache        |
|                                                                                                  |
+--------------------------------------------------------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key idea: Swarm can run as a full agent orchestration stack or as a standalone LLM gateway without requiring two unrelated frameworks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Mode 1: Deterministic Multi-Agent Orchestration with MCP
&lt;/h2&gt;

&lt;p&gt;Coordinating multiple agents becomes much easier when service boundaries and message contracts are explicit.&lt;/p&gt;

&lt;p&gt;Mode 1 splits responsibilities across decoupled, specialized services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Planner Agent:&lt;/strong&gt; Analyzes incoming user requests and dynamically constructs execution DAGs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Executor Agent:&lt;/strong&gt; Resolves task dependencies and controls step execution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Domain Specialists :&lt;/strong&gt; Execute live tools via a native &lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt; runtime (supporting SSE and streaming tool calls).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discovery &amp;amp; Memory :&lt;/strong&gt; Maintain service registries and conversational state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluation Service :&lt;/strong&gt; Built-in LLM-as-a-Judge validation loop for output verification and self-correction.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Inter-agent communication relies on type-safe agent-to-agent (A2A) message contracts, catching many contract and integration errors during development and compilation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Request
    ↓
Planner
    ↓
Execution DAG
    ↓
Executor
    ↓
Weather Agent
    ↓
MCP Weather Tool
    ↓
Evaluation
    ↓
Final Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Mode 2: OpenAI-Compatible Model Gateway
&lt;/h2&gt;

&lt;p&gt;Mode 2 exposes an OpenAI-compatible gateway for client applications, developer tools, and automated pipelines.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OpenAI Compatibility (&lt;code&gt;POST /v1/chat/completions&lt;/code&gt;):&lt;/strong&gt; Works with standard OpenAI SDKs, Cursor, and developer extensions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stateful Responses (&lt;code&gt;POST /v1/responses&lt;/code&gt;):&lt;/strong&gt; Supports multi-turn conversation chaining using explicit &lt;code&gt;previous_response_id&lt;/code&gt; references.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unified Multi-Provider Routing:&lt;/strong&gt; Route requests across &lt;strong&gt;Groq&lt;/strong&gt;, &lt;strong&gt;Google Gemini&lt;/strong&gt;, &lt;strong&gt;OpenAI&lt;/strong&gt;, or local backends such as &lt;strong&gt;Ollama&lt;/strong&gt;, &lt;strong&gt;vLLM&lt;/strong&gt;, and &lt;strong&gt;llama.cpp&lt;/strong&gt; through TOML configuration.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[server]&lt;/span&gt;
&lt;span class="py"&gt;bind_address&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.0.0.0:8080"&lt;/span&gt;
&lt;span class="py"&gt;log_level&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"info"&lt;/span&gt;

&lt;span class="nn"&gt;[models]&lt;/span&gt;
&lt;span class="py"&gt;default_model&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"openai/gpt-oss-20b"&lt;/span&gt;

&lt;span class="nn"&gt;[providers.groq]&lt;/span&gt;
&lt;span class="py"&gt;api_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://api.groq.com/openai/v1/chat/completions"&lt;/span&gt;

&lt;span class="nn"&gt;[providers.google]&lt;/span&gt;
&lt;span class="py"&gt;api_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://generativelanguage.googleapis.com/v1beta/models"&lt;/span&gt;

&lt;span class="nn"&gt;[providers.custom]&lt;/span&gt;
&lt;span class="c"&gt;# Local inference (Ollama / vLLM / llama.cpp / LocalAI)&lt;/span&gt;
&lt;span class="py"&gt;api_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"http://localhost:11434/v1/chat/completions"&lt;/span&gt;
&lt;span class="py"&gt;recommended_models&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"llama3.2:latest"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"mistral:latest"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"deepseek-r1:8b"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why Rust?
&lt;/h2&gt;

&lt;p&gt;Rust gives Swarm a few useful properties for orchestration and gateway workloads:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;⚡ Low-Overhead Request Handling:&lt;/strong&gt; Built on Tokio and Hyper for asynchronous, high-concurrency gateway workloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🔒 Concurrent Session Management:&lt;/strong&gt; &lt;code&gt;DashMap&lt;/code&gt; and &lt;code&gt;Arc&lt;/code&gt;-based stores allow shared state across concurrent requests without a global application lock.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🪶 Small Runtime Footprint:&lt;/strong&gt; No garbage collector and predictable memory ownership make the gateway suitable for lightweight deployments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🛡️ Strongly Typed Protocols:&lt;/strong&gt; Internal MCP and A2A message contracts reduce schema mismatches and integration errors.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Quickstart
&lt;/h2&gt;

&lt;p&gt;You can test either mode locally in minutes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/fcn06/swarm.git
&lt;span class="nb"&gt;cd &lt;/span&gt;swarm

&lt;span class="c"&gt;# Configure your provider keys&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.example .env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Option A: Launch the Model Gateway (Mode 2)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./kickstart/gateway_kickstart/01_launch_gateway.sh

&lt;span class="c"&gt;# Test OpenAI-compatible completions&lt;/span&gt;
curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST http://localhost:8080/v1/chat/completions   &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt;   &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "model": "openai/gpt-oss-20b",
    "messages": [{"role": "user", "content": "Explain Swarm architecture in 2 sentences."}]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Option B: Launch Multi-Agent MCP Suite (Mode 1)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Launch agents, MCP server, and infrastructure services&lt;/span&gt;
./kickstart/multi_agent_orchestration_kickstart/01_launch_all.sh

&lt;span class="c"&gt;# Run a live MCP tool test query&lt;/span&gt;
./kickstart/multi_agent_orchestration_kickstart/02_test_weather_query.sh &lt;span class="s2"&gt;"What is the current weather in Boston ?"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Open Source &amp;amp; Community
&lt;/h2&gt;

&lt;p&gt;Swarm is fully open-source under the Apache-2.0 license. We rely on and contribute back to the emerging Rust AI ecosystem, including the official &lt;a href="https://github.com/modelcontextprotocol/rust-sdk" rel="noopener noreferrer"&gt;MCP Rust SDK&lt;/a&gt; and &lt;a href="https://github.com/EmilLindfors/a2a-rs" rel="noopener noreferrer"&gt;A2A Protocol&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'm especially interested in feedback from people running agent systems or LLM gateways in production:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Would you rather deploy the orchestration and gateway as one runtime, or keep them completely separate?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you try Swarm, I'd also love feedback on the MCP runtime, gateway compatibility, and APIs.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>ai</category>
      <category>mcp</category>
      <category>agents</category>
    </item>
    <item>
      <title>Stop Giving AI Agents Your API Keys: Introducing Trust Gateway.</title>
      <dc:creator>fcn06</dc:creator>
      <pubDate>Mon, 10 Aug 2026 15:44:10 +0000</pubDate>
      <link>https://dev.to/fcn06/stop-giving-ai-agents-your-api-keys-introducing-trust-gateway-wip-1c8f</link>
      <guid>https://dev.to/fcn06/stop-giving-ai-agents-your-api-keys-introducing-trust-gateway-wip-1c8f</guid>
      <description>&lt;p&gt;AI agents are getting increasingly capable at calling tools: issuing refunds, updating tickets, sending emails, modifying infrastructure, querying databases, and triggering deployment pipelines.&lt;/p&gt;

&lt;p&gt;But there’s a security problem I kept coming back to:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why should the agent itself possess the credentials needed to perform those actions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If an agent has a Stripe key, GitHub token, cloud credential, or database password, then the security boundary is effectively inside the agent runtime.&lt;/p&gt;

&lt;p&gt;I wanted to see if there was a cleaner way to decouple intent from execution, so I started building a small side project called &lt;strong&gt;Trust Gateway&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It’s very much a work in progress, and I’m sharing it early to get feedback from the community on the core design, hear how others are approaching this, and learn where it can be improved.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The idea&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Trust Gateway separates &lt;strong&gt;proposing an action&lt;/strong&gt; from &lt;strong&gt;having authority to execute it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The model is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Agents propose. Gateway decides. Executors verify.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of giving an AI agent a downstream API key, the agent submits a structured &lt;code&gt;ProposedAction&lt;/code&gt; to the gateway.&lt;/p&gt;

&lt;p&gt;The gateway evaluates that action against policy.&lt;/p&gt;

&lt;p&gt;If it is allowed, the gateway issues a short-lived, cryptographically signed &lt;code&gt;ExecutionGrant&lt;/code&gt; bound to the exact tool and parameters that were approved.&lt;/p&gt;

&lt;p&gt;The gateway dispatches the granted action to the appropriate executor. Before any side effect, the executor independently verifies the grant's signature, expiry, audience, tool binding, argument hash, and single-use nonce.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────┐       ProposedAction       ┌───────────────┐
│  AI Agent  │ ─────────────────────────▶ │ Trust Gateway │
└────────────┘                            └───────┬───────┘
                                                │
      No downstream credentials                 │ GrantedAction
                                                │ + ExecutionGrant
                                                ▼
                                        ┌───────────────┐
                                        │   Executor    │
                                        │ owns API key  │
                                        └───────┬───────┘
                                                │
                                                ▼
                                               API
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important part is that the executor does &lt;strong&gt;not&lt;/strong&gt; trust the agent when it says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“This action was approved.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It verifies the authorization itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why I think this matters&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Imagine an agent with a tool like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stripe.refund(  
    payment_id="...",  
    amount=50000  
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are several possible policies you might want:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reading a customer record → automatically allowed
&lt;/li&gt;
&lt;li&gt;Refunding €5 → automatically allowed
&lt;/li&gt;
&lt;li&gt;Refunding €500 → requires human approval
&lt;/li&gt;
&lt;li&gt;Refunding €50,000 → always denied
&lt;/li&gt;
&lt;li&gt;Calling a tool with unexpected parameters → denied&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But even if you implement those policies inside your agent framework, the agent may still hold the credential that bypasses them.&lt;/p&gt;

&lt;p&gt;Trust Gateway moves that authorization boundary outside the agent.&lt;/p&gt;

&lt;p&gt;The agent can ask.&lt;/p&gt;

&lt;p&gt;It cannot simply decide.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What an integration looks like&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The Python SDK lets you guard a tool using a decorator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;trust_gateway.client&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;TrustGatewayClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;guard_tool&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;TrustGatewayClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dev_mode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;  
    &lt;span class="n"&gt;gateway_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://localhost:3060&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@guard_tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;stripe_refund&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;process_refund&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;  
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;refunded&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;amount&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;amount&lt;/span&gt;  
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when an agent attempts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;process_refund(  
    amount=500,  
    order_id="ord_123"  
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the function is not automatically executed.&lt;/p&gt;

&lt;p&gt;Trust Gateway first evaluates the proposed action.&lt;/p&gt;

&lt;p&gt;A policy can return something like:&lt;/p&gt;

&lt;p&gt;require_approval&lt;/p&gt;

&lt;p&gt;and no execution grant is issued until the required approval exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Execution grants&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I wanted authorization to be independently verifiable, rather than just another HTTP response saying &lt;code&gt;"approved": true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So Trust Gateway defines an &lt;strong&gt;Execution Authorization Protocol&lt;/strong&gt; with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;structured &lt;code&gt;ProposedAction&lt;/code&gt; objects
&lt;/li&gt;
&lt;li&gt;deterministic canonical JSON
&lt;/li&gt;
&lt;li&gt;SHA-256 input hashing
&lt;/li&gt;
&lt;li&gt;Ed25519 signatures
&lt;/li&gt;
&lt;li&gt;short-lived grants
&lt;/li&gt;
&lt;li&gt;single-use &lt;code&gt;jti&lt;/code&gt; nonces
&lt;/li&gt;
&lt;li&gt;grants bound to the exact tool and parameter set&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means an authorization for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{  
  "tool": "stripe_refund",  
  "amount": 500  
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;cannot simply be reused to execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{  
  "tool": "stripe_refund",  
  "amount": 50000  
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The parameters are part of what is authorized.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Human-in-the-loop without putting humans everywhere&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I also wanted HITL to be a policy decision rather than the architecture itself.&lt;/p&gt;

&lt;p&gt;Not every tool call should trigger a Slack message asking someone to click Approve.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;search_docs          → allow&lt;br&gt;&lt;br&gt;
read_customer        → allow&lt;br&gt;&lt;br&gt;
send_email           → require approval&lt;br&gt;&lt;br&gt;
stripe_refund &amp;lt; $20  → allow&lt;br&gt;&lt;br&gt;
stripe_refund &amp;gt;= $20 → require approval&lt;br&gt;&lt;br&gt;
delete_database      → deny&lt;/p&gt;

&lt;p&gt;The gateway can distinguish between routine actions and high-impact mutations.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Quickstart&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;You can run it locally with Docker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/fcn06/trust_gateway.git
&lt;span class="nb"&gt;cd &lt;/span&gt;trust_gateway
docker compose &lt;span class="nt"&gt;-f&lt;/span&gt; deploy/docker-compose.yml up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then install the Python SDK:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; sdks/python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There’s also a standalone Docker demo if you don’t want to install Rust.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What Trust Gateway is — and isn't&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Trust Gateway isn't intended to make an LLM itself trustworthy.&lt;/p&gt;

&lt;p&gt;It also isn't a replacement for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sandboxing
&lt;/li&gt;
&lt;li&gt;IAM
&lt;/li&gt;
&lt;li&gt;secret management
&lt;/li&gt;
&lt;li&gt;network isolation
&lt;/li&gt;
&lt;li&gt;application-level authorization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead, it addresses a narrower problem:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do we let an autonomous or semi-autonomous agent request privileged actions without giving that agent unrestricted possession of the authority required to perform them?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is the security boundary I'm exploring.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Where I'd love feedback&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The project is still evolving, and I’m especially interested in feedback from people building:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI agents with real side effects
&lt;/li&gt;
&lt;li&gt;MCP/tool servers
&lt;/li&gt;
&lt;li&gt;internal developer platforms
&lt;/li&gt;
&lt;li&gt;financial or support automation
&lt;/li&gt;
&lt;li&gt;agentic DevOps workflows
&lt;/li&gt;
&lt;li&gt;security infrastructure for autonomous systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’d particularly love opinions on the protocol design and threat model.&lt;/p&gt;

&lt;p&gt;GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/fcn06/trust_gateway" rel="noopener noreferrer"&gt;https://github.com/fcn06/trust_gateway&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're building agents that can do more than just generate text, I'd be curious:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where do you currently put the authorization boundary between the model and the systems it can modify?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;#ai #mcp #god-mode #agents #opensource&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>mcp</category>
      <category>godmode</category>
    </item>
  </channel>
</rss>
