Trust-Bridge

Somewhere in dist_agent_lang there is a function whose job is to look at two strings and decide whether “centralized” and “decentralized” are allowed to be in the same room without throwing furniture. That function is literally named bridge_trusts. It lives in src/stdlib/trust.rs (and is re-exported through cloudadmin so your marketplace demos can sound enterprisey without lying about where the logic lives).

This article explains what bridge_trusts and validate_hybrid_trust do—and how the runtime carries trust across deployment postures.

Does it run a zk-proof? No. Does it negotiate TLS handshakes? Also no. It checks whether you passed the magic tokens it expects: "admin" on the centralized side and "user" on the decentralized side. If that sounds like a unit test wearing a trench coat and calling itself an architecture—welcome. The value is not mysticism; it is having a single, auditable place where “did we even try to reconcile these two trust stories?” gets answered before your DAL program pretends everything is fine.

Its sibling validate_hybrid_trust is the sibling who does not trust anyone: both inputs must be the literal "valid". Hybrid is not “everyone gets a trophy.” Hybrid is “two parties both said the word we agreed means not obviously lying right now.”

What the runtime actually bridges

Bridging is not only those two helper functions. The runtime engine (src/runtime/engine.rs) carries a ServiceContext with a trust_model string—typically "centralized", "hybrid", or "decentralized" (parsed from @trust("...") on your service). That string is not decorative wallpaper. It feeds validate_admin_access, validate_cloudadmin_access, validate_web_trust, validate_ai_trust, and validate_chain_trust.

Roughly:

  • Centralized is the “fine, I’ll hold the keys” mode: admin and cloudadmin paths are open; web/AI/chain are permissive at the trust layer.
  • Hybrid is the “bring receipts” mode: you only get admin-ish or cloudadmin-ish powers if the service is decorated accordingly (@admin, @cloudadmin), and web/AI/chain need explicit privilege flags (@web, @ai, @chain(...)).
  • Decentralized is the “nobody gets the aux cord” mode for elevated control planes: admin and cloudadmin validation tends to fail closed; chain and friends still need explicit capability flags.

So the real bridge is not a slogan—it is one engine that applies one policy matrix based on how you annotated the service. Same bytecode surface, different blast radius.

Keys, because vibes are not a security primitive

Before the admin registry gets to feel clever, trust::authorize tries key::check with a capability request (src/stdlib/key.rs). Capabilities expire; denials can hit audit logs in strict mode. That is the project’s DNA: split the problem between “does this principal have an explicit grant?” and “do legacy admin rules still say OK?”—then log what happened.

If you turn on compliance key gating (DAL_COMPLIANCE_KEY_GATE), sensitive kyc:: / aml:: operations consult key::check again with a configurable principal (DAL_COMPLIANCE_PRINCIPAL). The bridge here is boring and therefore good: policy env vars + capability registry + runtime permission errors instead of “we assumed the CFO read the Slack thread.”

Shell and IDE: bridges you trip over on purpose

sh::run (src/stdlib/sh.rs) bridges “user wants a subprocess” with “we are not running curl | bash because a model got confident.” Trust levels (off / sandboxed / confirmed / trusted) come from env and agent.toml / dal.toml sections. If an owner principal is set, key::check("sh", "run", ...) can short-circuit the romance.

In the IDE agent loop (src/ide/agent_runner.rs), bridging model intent and filesystem reality is literally is_capable(tool_name): if the tool is not in the agent’s configured capability list, the runtime does not pretend the invocation succeeded—it feeds the error back into the conversation. That is trust as UX: fail in-band, stay debuggable.

Why this article exists

Trust-Bridge in dist_agent_lang is not a whitepaper fantasy about “seamless interoperability.” It is a stack of explicit gates: string-level helpers for demos and tests, service trust models that widen or narrow whole classes of behavior, capabilities that tie principals to resources, and agent/ shell policy that assumes the dumbest possible mistake is about to happen—because it is.

If your program bridges trust without hitting any of those layers, you did not bridge trust; you merged attack surfaces and called it synergy.