Skip to content

Cross-Project Agent Composition (abt Loom)

abt Loom enables teams to reference agents from other projects without copy-paste. Inspired by dbt-loom's manifest-as-contract pattern — upstream projects publish their compiled manifest, consumers import public agents at compile time.

How it works

Upstream Project (Team A)         Consumer Project (Team B)
┌─────────────────────┐          ┌──────────────────────┐
│ agents/              │          │ agents/              │
│   db-investigator.md │──publish──▶ abt_loom.yaml       │
│     access: public   │          │   ↓                  │
│ target/manifest.json │          │ subagents: [team-a.db-investigator]
└─────────────────────┘          └──────────────────────┘
  1. Upstream compiles normally (abt compile)
  2. Upstream publishes target/manifest.json (local path, S3, or HTTP)
  3. Consumer declares upstream in abt_loom.yaml
  4. Consumer references upstream agents with a subagents: entry naming project.agent
  5. At compile, abt fetches the manifest and injects public agents into the consumer's DAG

Directory layout (monorepo)

repo-root/
├── infra-agents/              ← Team A's project (upstream)
│   ├── abt.yaml
│   ├── profiles.yaml          ← own credentials
│   ├── agents/
│   └── target/manifest.json   ← written by `abt compile`
├── platform-tools/            ← Team B's project (upstream)
│   ├── abt.yaml
│   ├── profiles.yaml
│   ├── agents/
│   └── target/manifest.json
└── my-project/                ← consumer
    ├── abt_loom.yaml          ← registry: the upstream projects this one reads
    ├── abt.yaml
    ├── profiles.yaml
    └── agents/

Each project has its own profiles.yaml. Compile the upstream projects first: the consumer reads their target/manifest.json, and a missing manifest stops its compile. To drop that build order, publish each upstream manifest and point the registry at the published copy (see Publishing Manifests).

ERROR: Loom: upstream 'infra-agents' manifest not found: Upstream manifest not found: <repo-root>/infra-agents/target/manifest.json

Configuration

abt_loom.yaml (in the consumer project)

abt looks for abt_loom.yaml in the project root and then in each parent directory, and loads the manifest of every project it lists. Keep the registry in the consumer only. A registry at repo-root/ would also be found by infra-agents and platform-tools, which would then read each other's manifests, and neither could compile first.

projects:
  - name: infra-agents
    manifest: ../infra-agents/target/manifest.json

  - name: platform-tools
    manifest: ../platform-tools/target/manifest.json

A relative manifest path resolves from the directory that holds abt_loom.yaml.

Remote manifest sources:

projects:
  - name: infra-agents
    manifest:
      type: s3
      config:
        bucket: <your-bucket>
        key: infra-agents/prod/manifest.json
        region_name: eu-central-1

Supported types: local (default for string paths), s3, http.

An http source sends its headers only to the configured origin. If the server redirects to a different scheme, host or port, the redirected request carries none of them. A same-host http → https upgrade on the default ports keeps them.

Options

Field Default Description
name required Unique project identifier
path optional Relative path to the entry's own project root. A project skips the entry whose path is its own root
manifest required Path or {type, config} source for manifest.json
include all public Whitelist of agent names to import
exclude none Blocklist of agent names to skip
optional false When true, missing manifest = warning not error
staleness_threshold_days 7 Warn when manifest is older than this
mode import import runs the agent locally; remote (experimental) calls it over HTTP — see Execution modes
endpoint — Producer's invoke API base URL. Required when mode: remote
auth — {type: bearer, token_env: VAR}. VAR is the env var that holds the bearer token. abt resolves it at runtime and never stores it in the manifest.
timeout_seconds 600 Max seconds the consumer waits for one remote call (submit + poll). mode: remote only

Environment variable interpolation

Config values in abt_loom.yaml support {{ env_var('NAME') }} / {{ env_var('NAME', 'default') }} calls:

projects:
  - name: infra-agents
    manifest:
      type: s3
      config:
        bucket: "{{ env_var('ABT_ARTIFACTS_BUCKET') }}"
        key: "infra-agents/{{ env_var('DEPLOY_ENV') }}/manifest.json"

Making agents public

In the upstream project, add access: public to agent frontmatter. Save this as infra-agents/agents/db-investigator.md, and give platform-tools a deploy-checker agent the same way:

---
name: db-investigator
description: Investigates database issues
access: public
---

You are a database investigator...
  • protected (default) — only usable within its own project; any in-project agent may activate it
  • private — local-only and, when a group is set, activatable only by same-group agents (see Access & groups)
  • public — other projects can reference this agent via Loom

Referencing upstream agents

Save this as agents/coordinator.md in the consumer project:

---
name: coordinator
description: Routes database and deployment issues to the right specialist.
subagents:
  - infra-agents.db-investigator
  - platform-tools.deploy-checker
---

For database issues, delegate to `infra-agents.db-investigator`.
For deployment issues, delegate to `platform-tools.deploy-checker`.

Syntax: project_name.agent_name — dot-separated qualified name.

Compile the two upstream projects, then the consumer. Run each command in the project's own directory:

cd infra-agents && abt compile       # writes infra-agents/target/manifest.json
cd ../platform-tools && abt compile  # writes platform-tools/target/manifest.json
cd ../my-project && abt compile && abt list

The consumer compiles its own agent plus the public agents it imports:

  Manifest ready (3 agents).
Compiled 3 agent(s).
...
coordinator
infra-agents.db-investigator
platform-tools.deploy-checker

Execution modes: import vs remote

Experimental — mode: remote and its wire protocol are new; the HTTP API shape may still change in a minor release. The default import mode is stable.

A loom dependency can be consumed in one of two modes, set per project entry with mode:.

import (default) remote
Reference resolves to a subagent node in the consumer's DAG a tool on the caller agent
Executes in the consumer's process the producer's abt watch consume --serve-api workers
Needs the producer's MCP defs + secrets? yes (they travel in the manifest / your env) no — the producer owns creds, model, rate-limits, observability
Manifest used for definition and execution metadata only (tool description)

Use import to run someone else's agent as your own. Use remote when a team wants to own the runtime and expose an agent as a service — you call it, you don't copy it. The subagents: entry (project.agent name) is identical either way; only the registry entry's mode changes.

Producer: expose agents over HTTP

The producing project serves the invoke API from abt watch consume --serve-api. The command, endpoints and auth are in abt watch: Agent invoke API, and a manifest is in Deploying to Kubernetes.

Only agents marked access: public are invokable, the same gate as import. Everything else returns 403 E_LOOM_ACCESS_DENIED. The loom remote tool sends only input. vars is for direct HTTP callers.

Consumer: declare the dependency as remote

# abt_loom.yaml
projects:
  - name: mock
    manifest:                       # still needed — for the tool's description
      type: http
      config:
        url: https://artifacts/mock/manifest.json
    mode: remote
    endpoint: http://mock-watch.mock.svc.cluster.local:8080
    include: [montecarlo-investigator]
    auth:
      token_env: ABT_INVOKE_TOKEN   # env var NAME; the token is read at runtime
    timeout_seconds: 300            # optional; default 600

Save this as agents/coordinator.md:

---
name: coordinator
description: Routes data-quality alerts to the remote investigator.
subagents:
  - mock.montecarlo-investigator
---
For MC alerts, call `mock.montecarlo-investigator`.

You write none of this on the agent itself. At compile time, abt attaches the registry entry (endpoint, agent_name, auth_token_env, timeout_seconds) to the delegating agent. Its delegation then becomes an HTTP submit-and-poll call, and abt does not build the upstream agent locally.

The compiler synthesises an HTTP submit-and-poll tool: it POSTs the task, then polls the run until it finishes, and hands the output back to the caller LLM as a normal synchronous delegation. If the caller gives up first (the timeout_seconds deadline, a failed poll, or the calling run being cancelled), it asks the producer to cancel the run so it stops spending; a cancelled run comes back as a failed call. The status and cancel URLs the producer returns must be on the same scheme, host and port as endpoint: the bearer token is sent with every request, so a different origin is refused and the call fails. Transient HTTP errors are retried; auth/permission errors are reported so the model can react instead of crashing the run.

Security notes

  • Platform-agnostic. Remote mode is plain HTTP plus an env-var secret. It works the same on Kubernetes, Docker Swarm, compose, VMs or localhost: anything that can inject an env var and route HTTP. The examples in these docs use Kubernetes.
  • Auth is optional. To run open, omit auth: on the consumer and leave the token env var unset on the producer. Do this only when the network layer already enforces the boundary (default-deny NetworkPolicy, service mesh mTLS, private compose network). Kubernetes namespaces do NOT isolate traffic by default. Without NetworkPolicies, any pod in the cluster can reach the endpoint. Keep the token unless you know your policies.
  • bearer is the only auth.type today — the field is the extension point; future methods (k8s ServiceAccount tokens, mTLS, OAuth) converge there rather than adding parallel config.
  • No secret in the artifact — auth.token_env stores the env var name; the token is resolved at runtime on the consumer. Set the same ABT_INVOKE_TOKEN on both the producer and consumer.
  • Public-only — only access: public agents can be invoked remotely.
  • Defense in depth — pair the bearer token with a NetworkPolicy (and mTLS if you run a service mesh). Pod-to-pod over a ClusterIP Service needs no ingress, so no proxy timeouts.

Loom deps and delegation depth

A loom dependency is a capability edge: a contract with another team, consumed much like an MCP tool. abt run -s <agent> always wires that agent's full subagents: tree. No flag strips it down. This holds for loom deps (import and remote) like any other subagents: entry, everywhere the agent runs: abt run, abt dispatch and Slack or Jira-triggered abt watch entrypoints.

This is what makes consuming another team's agent feel like adding a tool: you reference it, it's there.

Configuring an imported agent's own depth (depth:)

A loom dep also has its own subtree (the upstream agent's helpers). By default it builds unbounded — the whole upstream agent works out of the box. Pin it per reference with a depth: override in the subagents: single-key mapping form. Save this as agents/coordinator.md:

---
name: coordinator
description: Delegates database issues to the upstream investigator.
subagents:
  - infra-agents.db-investigator:
      depth: 2        # build the upstream agent + 2 levels of its subtree; 0 = leaf only
---
Delegate to `infra-agents.db-investigator`.
  • depth unset → unbounded (the upstream agent's full tree).
  • depth: 0 → the upstream agent as a leaf (its own subagents not wired).
  • depth: N → the upstream agent plus N waves of its subtree.

depth only affects import deps — a remote dep is a single HTTP leaf, so its subtree lives (and is bounded) on the producer. (Note: for import, the upstream agent's own subagents must themselves be published/included in the manifest to be wired.)

"Use another team's agent like genie/an MCP"

When a team exposes an agent and others want to drop it into their own Slack/Jira workflows without owning its runtime, use mode: remote. It behaves like an MCP tool: a single call, always available, no credentials or MCP defs copied, and the producing team keeps ownership of the model, secrets, rate-limits, and observability. Prefer remote over import for this pattern — import copies the definition and needs the producer's secrets in your environment.

Immutability

Foreign agents are frozen. The consumer project cannot override:

  • Middleware stack
  • Model ID / temperature / model_kwargs
  • model_call_limit / token_budget middleware
  • Tools / skills
  • Output schema

The upstream agent runs exactly as compiled by its source project. Consumer only controls what prompt/context is passed TO the agent.

Error handling

Scenario Behavior
Private agent referenced via include Compile error with actionable message
Missing manifest (optional: false) Compile error
Missing manifest (optional: true) Warning, compile continues. The warning is a log line: it shows on the console with --debug and is always written to logs/abt.log
Stale manifest (older than threshold) Warning at compile, shown the same way as the optional-manifest warning
Agent in include not in the upstream manifest Compile error listing the available agents (does not contain agent(s): ['other']. Available: ['db-investigator'])
Local agent delegates to an upstream agent that doesn't exist Compile error: Agent 'coordinator' delegates to unknown agent 'infra-agents.nosuch'
Local agent conflicts with upstream name Local wins (warning logged)

UI

External agents appear in abt docs with: - Red dashed border in the dependency graph - EXTERNAL badge in the agent detail view - Origin metadata showing which upstream project they come from

Publish and consume

# Team A: compile and publish
cd infra-agents
abt compile
abt publish          # push to configured targets
# or: abt publish --local   (zero-config for same-machine dev)

# Team B: consumer uses upstream agents
cd my-project
abt compile    # resolves upstream via abt_loom.yaml
abt run -s coordinator -p "investigate this"

See Publishing Manifests for full publish configuration and CI/CD setup.

Edits to abt_loom.yaml take effect on the next abt compile: the file is part of the compile cache key, so there is no need for --no-partial-parse.

No abt_loom.yaml = feature inactive

If no abt_loom.yaml is found walking up from the project root, the feature does nothing. Zero overhead, zero behavior change. Fully opt-in.