Skip to content

2.6 Service Catalog: Teams, Callers, Targets & Policy

The catalog is the single place that says which targets exist (agents, MCP servers, models, legacy APIs), which team owns each one, which callers may call it, through which gateway, and who pays for the calls. Terraform, the entry point, the invoker grants and esmeralda verify all derive from it, so adding a caller or a target is a catalog change reviewed by the owning team.

Two principles shape it:

  • Where the data lives is pluggable; enforcement is compiled. The catalog can be assembled from several sources (Git files, Agent Registry, project labels, a CMDB). esmeralda catalog resolve merges and validates them, and compiles the result into what the platform enforces. Neither the runtime nor Terraform ever reads a source directly.
  • Contracts, not implementations. Every document follows contracts/catalog.schema.json (schema: esmeralda.catalog, integer schema_version, additive changes only). Any source that produces documents of that shape can feed the resolver.

1. Data model

Section Holds Natural source in a real organization
teams cost centres, country, external flag project labels, finance, CMDB
callers (non-workload identities) identity type + id → team IdP groups, Apigee apps, federation config
targets kind, owner_team, deploy (unit, or managed: false + endpoint), serving, gateway, callers (tools, quota, product, allowed cost centres, gateway per caller), user_credential, models, observability Agent Registry, API Hub, Backstage (inventory); Git (policy)
policy attribution.unmapped_caller (deny / flag), attribution.declared_mismatch (reject / bill_own_team), verify.catalog_drift (warn / fail), defaults, registered usage dimensions platform and security

Agents call as themselves: a target of kind a2a or adk can be listed directly under another target's callers. Every other identity is declared under callers with its team and an identity of type service_account, group, apigee_app, federated (OIDC issuer + subject) or spiffe. When the platform creates the identity, the identity points at a unit output (ref: layer-3-security:<output>) rather than a pasted value.

The calling team pays. A caller's grant may list the cost_centers it is allowed to declare; they must belong to that caller's team.

An example target:

schema: esmeralda.catalog
schema_version: 1
name: order-ops-specialist
kind: a2a
owner_team: ai-coe
deploy: { unit: agents/order-ops-specialist }
serving: { token: access, probe: a2a }
models: [gemini-flash]
callers:
  support-assistant: { cost_centers: [cc-cx-br, cc-cx-mx] }
  test-vm: {}
observability:
  usage_sources: [gateway, workload]
  framework: adk
  dimensions: [support_category]
  slo: { latency_p95_ms: 10000, availability: 0.995 }

2. Folder layout (the default files source)

catalog/
├── README.md
├── sources.yaml                 # which sources the resolver merges, in order
├── teams.yaml                   # team registry
├── policy.yaml                  # attribution rules, defaults, registered dimensions
├── teams/
│   ├── ai-coe/{team.yaml, agents/…, mcp/…}
│   ├── cx/{agents/…}
│   └── platform/{callers.yaml, models/…}
├── external/
│   ├── partners/…               # Apigee apps -> partner teams
│   ├── clouds/…                 # federated (issuer, subject) callers
│   └── legacy/…                 # managed: false endpoints (brownfield)
├── environments/{dev.yaml, prd.yaml}   # overrides only
└── .resolved/{dev.json, prd.json}      # generated and committed: what Terraform reads

Ownership comes from CODEOWNERS: each team approves its own teams/<team>/ folder, while platform and security approve external/, policy.yaml and sources.yaml (catalog/README.md has a snippet). Entries marked example: true (the samples under external/) are resolved and shown, but never compiled into enforcement.


3. Resolve, compile, inspect

uv run esmeralda catalog resolve --env dev                  # full resolved catalog (JSON)
uv run esmeralda catalog resolve --env dev --format hcl     # the Terraform catalog map, as HCL
uv run esmeralda catalog resolve --env all --write          # regenerate catalog/.resolved/*.json
uv run esmeralda catalog resolve --env all --check          # exit 1 when a generated file is stale
uv run esmeralda catalog show --env dev                     # who can call what, via which gateway, who pays
uv run esmeralda catalog show --env dev --format tree       # compact tree layout instead of callers tables
uv run esmeralda catalog show --env dev --no-legend         # omit the trailing field and badge legend
uv run esmeralda catalog show --env dev --caller test-vm    # everything one caller can call
flowchart LR
  S["sources.yaml (in order)"] --> M["merge"]
  M --> O["environments/&lt;env&gt;.yaml overrides"]
  O --> D["policy defaults"]
  D --> V["validate: schema + references"]
  V --> R[".resolved/&lt;env&gt;.json"]
  R --> T["env.yaml catalog: entry point, direct backends, invokers, verify"]
  R --> G["env.yaml catalog_iap_egress: Agent Gateway per-target lists"]
  R --> X["env.yaml catalog_external_targets: registry entries of managed: false targets"]
  R --> A["env.yaml catalog_google_apis: layer-4 Google API entries"]
  1. Merge. Sources are merged in the order sources.yaml lists them. In the files source, an entry or a policy leaf defined twice is an error. A later source may add entries or fill fields an earlier source left unset; giving a different value for a field already set is a conflict.
  2. Override. environments/<env>.yaml is applied last: maps merge, lists replace, and null deletes a key (for example, callers: { test-vm: null } removes the test VM in one environment).
  3. Validate. The result is checked against the schema, then the references: unknown teams, callers, models or dimensions, duplicate names or units, and cost centres that a caller's team doesn't own all fail the resolve.
  4. Compile. Deployed targets (kind mcp, a2a or adk with a deploy.unit) become the catalog map in catalog/.resolved/<env>.json: kind, unit, token, probe, an optional timeout, and optional callers (agents, which get run.invoker / aiplatform.user as their Agent Identity principal, and service_account callers, which get them as their service account). Each infrastructure/live/<env>/env.yaml decodes it:

    catalog_sources = "catalog/sources.yaml"
    catalog         = lookup(jsondecode(file("${get_repo_root()}/catalog/.resolved/<env>.json")), "catalog")
    

    The generated files are committed with each catalog change, and make test-guards fails when they are stale.

  5. Compile the Agent Gateway lists. The same callers also become iap_egress in the same file: the per-target roles/iap.egressor member lists the Layer 5 iap-egress unit writes on each Agent Registry entry (agents for a2a targets, mcp_servers for mcp targets). Members are references, never pasted values: an agent caller contributes its Agent Identity principal (agents/<name>:agent_identity_principal), which is also the identity it calls out as, and a service_account caller contributes its ref. env.yaml decodes the lists as catalog_iap_egress, and the iap-egress unit maps each reference to the matching unit output (identity_refs). A reference with no mapping fails the plan.

    "iap_egress": {
      "agents":      { "order-ops-specialist": ["agents/support-assistant:agent_identity_principal",
                                                      "layer-3-security:test_vm_sa_email"] },
      "mcp_servers": { "customers": ["agents/order-ops-specialist:agent_identity_principal",
                                      "layer-3-security:test_vm_sa_email"] }
    }
    

    One callers entry therefore drives both the Cloud Run / Agent Runtime IAM grants and the gateway list, so the two can't disagree. A new agent caller also needs its dependency block and its identity_refs entry in the iap-egress unit (and in each MCP service unit, which grants it run.invoker as its principal); make test-guards checks that every reference has one and that each list names exactly the target's callers.

    A caller that reaches its targets directly, not through the Agent Gateway, is declared with agent_gateway: false. In dev, the Apigee partner-mcp proxy (apigee-partner-mcp) calls the MCP servers it exposes with its own ID token: it keeps run.invoker on them but is left out of their gateway lists, since Apigee never egresses through the Agent Gateway. A gateway-listed caller whose service account comes from a unit the iap-egress unit doesn't map (anything other than layer-3-security) fails the resolve with a hint to set the flag.

    No shared identity is added: agents call out with their own Agent Identity, so each list names only the target's callers. (The resolver still accepts a generic policy.agent_gateway.shared_workload_identity block, which adds one shared member to targets with an agent caller; this repository doesn't use it.)

  6. Register the targets Esmeralda doesn't deploy. A non-example target with deploy.managed: false (a legacy API, an agent on another cloud, an external gateway such as an Apigee model gateway) compiles into external_targets: one Agent Registry entry per target, which the Layer 5 iap-egress unit creates (env.yaml decodes it as catalog_external_targets). Its callers compile into iap_egress like any other target, so only they can reach it through the Agent Gateway:

    kind Registry entry iap_egress group
    http endpoint (HTTP_JSON, no spec) endpoints
    model on a non-Google host endpoint endpoints
    mcp MCP server (JSONRPC, no tool spec) mcp_servers
    a2a agent, with an A2A card generated from the catalog entry agents
    # catalog/environments/dev.yaml (overrides.targets): the synthetic target dev verifies with
    external-probe:
      kind: http
      owner_team: platform
      deploy: { managed: false, endpoint: "https://external-probe.{domain}" }
      callers:
        order-ops-specialist: {}
    
    • Hostnames. The Agent Registry matches exact hostnames (no wildcards), so endpoint is an exact https:// URL. Environment-specific parts are placeholders the iap-egress unit substitutes from layer outputs instead of literals: {domain} (the entry point domain, only as <label>.{domain}) and {region}. Two targets can't share a host, and a host can't be the <name>.{domain} of a deployed target. Hosts under a private domain other than the entry point domain also need DNS peering and CA trust in the Agent Connectivity Template (not compiled).
    • Google APIs. A target on *.googleapis.com (such as gemini-flash on Vertex AI) gets no entry of its own: its host is a layer-4 Google API entry, reachable only by the agents that declare that API in google_apis (see step 6b). An agent that lists such a model must declare its API, or the resolve fails; an unknown Google host fails too.
    • No callers, no access. A target whose callers are all unenforced (groups, federated or Apigee app identities) or absent is still registered, with an empty policy. Removing the target deletes its entry, so the gateway denies the host again; removing a caller rewrites the entry's policy without it.
    • Callee authentication is the target's business: the Agent Gateway neither adds nor swaps credentials. serving.token records what agents send (id: a Google ID token for the endpoint, as the Apigee model gateway, Cloud Run or API Gateway expect; access; or omitted).
    • Examples (example: true, such as external/legacy/example-legacy-warehouse.yaml) stay illustrative: they are never registered.
    • The Apigee model gateway is one: with governance.capabilities.model_gateway = "apigee", dev's overrides declare llm-gateway (kind: http, https://apigee.{domain}/llm, serving.token: id) with both agents as callers. Its callers are also the proxy's allowlist (Apigee llm-gateway), and make test-guards fails if it is declared where the capability is off, or missing where it is on.
    • Verification. esmeralda verify (step registry-egress) reads every registry entry and its IAP policy and fails unless the registry root holds no binding, each baseline Google API entry lists exactly the layer-4 members, each catalog entry lists exactly its compiled callers, each external target is registered with its exact URL, the registered Google API entries are exactly the declared ones, and any other entry has no policy. In dev, an allowed call from the specialist to external-probe.<domain> reaches the entry point and gets its no-route 404; any other agent gets the gateway's 403.

    The registry root never holds a roles/iap.egressor binding: a root binding would be inherited by every external entry (see 2.1 §3.4).

    6b. Declare the Google APIs each agent calls. Agents reach Google APIs through the Agent Gateway too, and the gateway only lets a caller reach registered hosts it's granted on. The catalog declares them, and layer 4 registers nothing else:

    # catalog/policy.yaml: every agent runtime
    policy:
      agent_gateway:
        google_apis:
          baseline: [telemetry, aiplatform_runtime_region, cloudresourcemanager, iamcredentials]
    
    # catalog/teams/ai-coe/agents/order-ops-specialist.yaml: this agent only
    google_apis: [aiplatform, bigquery, bigquerystorage, storage]
    

    They compile into google_apis in .resolved/<env>.json (env.yaml decodes it as catalog_google_apis): one Agent Registry entry per API at least one deployed agent may reach, keyed by its service id, with url, protocol_binding, description (see 6c), grant and callers.

    • Names come from the resolver's known-hosts table (esmeralda.catalog.GOOGLE_APIS): real, serving hostnames only, such as aiplatform (aiplatform.googleapis.com, the global model endpoint), aiplatform_runtime_region (<region>-aiplatform.googleapis.com, Agent Runtime sessions), bigquerystorage (gRPC). An unknown name fails the resolve. There are no mTLS, multi-region or REP variants: agents pin GOOGLE_API_USE_MTLS_ENDPOINT=never.
    • Baseline entries (grant: baseline) are granted by layer 4 to the agent projects' principalSets, so a replaced engine can start before its new identity is granted.
    • Per-agent entries (grant: callers) are granted by the iap-egress unit to each declaring agent's Agent Identity; they're in iap_egress.endpoints under the same key. No other agent can reach them.
    • Registration: layer 4 registers each entry as https://<host> and https://<host>:443 (gRPC clients send host:443). An API nobody declares isn't registered, and removing the last declaration removes the entry.
    • Guards (make test-guards): every compiled host is in the known-hosts table, each per-agent entry lists exactly the declaring agents (never a service agent or a project-wide set), and the code signals of each agent (model location, sessions, --otel-to-cloud, the BigQuery analytics plugin, literal *.googleapis.com hosts) are covered by its declarations.

    6c. Registry descriptions. Every Agent Registry entry Esmeralda creates says why it exists and who uses it, so an operator can tell from the console whether an entry is safe to remove. The text comes from the catalog and is compiled into .resolved/<env>.json as description:

    • Google APIs: the API's description in the known-hosts table, which names the client that calls it (for example bigquerystorage: the BigQuery Agent Analytics plugin's AppendRows writes).
    • MCP servers, A2A agents and managed: false targets: the target's description, which is required for any target with a registry entry (at most 1,024 characters).
    • Who uses it: a generated suffix, Used by: <callers> (the target's catalog callers, or the agents that declare the API; Used by every agent (baseline): ... for baseline APIs).

    Layer 4, the iap-egress unit and the MCP and agent units pass it to google_agent_registry_service.description, an in-place update. The resolve fails when a description is missing or the result is over the Agent Registry limit (2,048 characters), and a guard checks that every google_agent_registry_service resource sets one.

  7. Compile verified attribution. The same callers compile into an attribution block: the principal_teams rows (each verified principal, its catalog caller and the team that pays), the shared identities, and per-target allowlists for the in-process caller guard on MCP servers (ESMERALDA_CALLER_ALLOWLIST). policy.attribution.unmapped_caller (deny, or flag in the environments listed in flag_environments) and declared_mismatch (reject or bill_own_team) decide what the guard does with unknown callers and foreign cost centres. The compile fails if a principal that gets a grant has no team, or if one principal maps to two teams. See 5.3 §5.

Later phases compile the same resolved catalog into Apigee products and allowed_tools, Agent Gateway rules beyond caller lists and observability configuration.


4. Swapping or adding sources

The model (entry states, merge rules, invariants) is summarized in 2.7 Catalog Sources; this section has the configuration and the details of each source type.

catalog/sources.yaml lists the sources:

schema: esmeralda.catalog
schema_version: 1
sources:
  - { name: catalog-files,   type: files, paths: [teams.yaml, policy.yaml, teams, external] }
  - { name: agent-registry,  type: agent_registry, enabled: false,    # see "Agent Registry" below
      options: { projects: [governance, ai_coe_agents, cx_agents, mcps] } }
  - { name: backstage,       type: backstage, enabled: false,         # see "Backstage" below
      options: { base_url: "https://backstage.example.com", token_env: ESMERALDA_BACKSTAGE_TOKEN } }
  - { name: project-labels,  type: project_labels, enabled: false,    # see "Project labels" below
      options: { team_label: team, cost_center_label: cost-center } }
environments_dir: environments
resolved_dir: .resolved
Organization Typical setup
Greenfield / demo files only (the default)
Inventory already in Agent Registry or API Hub agent_registry reports what exists; files keeps policy, callers and grants, and adopts entries by pin
Teams and cost centres in project labels or finance systems project_labels maps projects to the teams declared in files (attribution only)
Services and owners in Backstage backstage reports components and APIs as inventory and fills team profiles; files adopts entities by pin
A CMDB or another catalog A custom adapter (copy the shape of the backstage one)
Source type Status Reads (read-only)
files built in, the default catalog YAML under catalog/
project_labels built in, disabled in this repo labels of the environment's projects (gcloud projects describe)
agent_registry built in, disabled in this repo agents, MCP servers and endpoints of Agent Registry (gcloud alpha agent-registry ... list)
backstage built in, disabled in this repo entities of the Backstage Catalog API (/api/catalog/entities/by-query), or a JSON export

Discovery never grants; adoption is a repo review. The merge rules hold for every source:

  • files must be the first enabled source, and it's the only one that may set authorization data: target callers and their grants (tools, quota, product, cost centres, gateway), the callers section, identities, policy, teams and their cost_centers, google_apis, user_credential, deploy.unit, serving, models, gateway and observability. environments/<env>.yaml overrides stay repo-reviewed too.
  • Any other source contributes only what the capability allowlist of its type permits (a code constant, never configuration). Anything else fails the resolve with a message naming the source and the field, for example my-cmdb: may not set targets.customers.callers. options.fields in sources.yaml can narrow a source, never widen it.
Source type May contribute
files everything
agent_registry inventory entries; on adopted targets: deploy.endpoint, runtime, runtime_resource, description, registry
project_labels teams.<existing team>.projects; owner_team of inventory entries another source reported
backstage inventory entries; on adopted targets: description, system, deploy.endpoint; team profile description, contacts, oncall
custom adapter what its CAPABILITIES declare, capped by the inventory and attribution fields above
  • External entries land in a separate inventory section of the resolved catalog. Inventory is shown but never compiled: no IAM, no Agent Gateway policy, no registry entry, no allowlist.
  • A catalog file adopts an inventory entry only through a pin, never by name: deploy: { managed: false, registry: { source: <source name>, id: <entry id> } } (the source fills the fields it may contribute when the file leaves them unset, endpoint included), or, for a Backstage entity, backstage: { source: <source name>, ref: <Kind:namespace/name> }. One file entry may carry both pins: that is how an Agent Registry entry and a Backstage entity for the same agent are joined (without it, two sources that derive the same name fail the resolve). An inventory entry named like an unpinned target fails the resolve, and so does a pin whose id the source doesn't report. Callers of an adopted target still come from the file. What an Agent Registry adoption compiles is described in Adopting a discovered agent.
  • Field strategies. strict fields (kind, owner_team, deploy.endpoint, runtime, runtime_resource, registry.id) must agree across sources, otherwise the resolve fails and names both origins. first fields (description, system, registry.skills, profile description/contacts/oncall) keep the earliest value (files first) and record the loser as shadowed. To override a strict external value, use environments/<env>.yaml.
  • Provenance and determinism. The resolved catalog (--format json) carries a provenance map: entry-level for every entry, field-level for each field an external source contributed or shadowed. When an external source contributed, .resolved/<env>.json also gets provenance and inventory_summary, so a reviewer sees which source changed a compiled value; for a files-only catalog both are omitted. Sources merge in sources.yaml order and entries in sorted order, so the output doesn't depend on adapter dict order or hash seeds.

A custom adapter is a small Python class that reports what it discovered as inventory:

from esmeralda.catalog import Layer, Source, register_source

@register_source("my_cmdb")
class CmdbSource(Source):
    # Inventory only: whole inventory entries, and the description of the targets that pin it.
    CAPABILITIES = {"inventory": ["*"], "targets": ["description"]}

    def load(self) -> Layer:
        layer = Layer(source=self.name)
        for item in read_export(self.spec.get("options", {})):  # your client or a file export
            layer.inventory[item.name] = {
                "kind": "http",
                "description": item.description,
                "deploy": {"endpoint": item.url},
                "registry": {"id": item.id},
            }
        return layer

Then add - { name: my-cmdb, type: my_cmdb, options: {...} } to sources.yaml after the files source. To put one of those entries under enforcement, a team adds a catalog file for it with the pin deploy.registry: { source: my-cmdb, id: <id> } and the callers it allows, and that change goes through review like any other grant.

Snapshots and catalog fetch

A source that reads a live system (Agent Registry, project labels, Backstage, an API) is read in two steps, so resolving the catalog never needs the network:

  1. esmeralda catalog fetch calls the adapter (network, read-only on the source), normalizes what it returns and writes a snapshot: catalog/snapshots/<source>/<env>.json (contracts/catalog-snapshot.schema.json; options.snapshot changes the path). The snapshot is committed and reviewed like any other catalog change, so every external change reaches the catalog through a pull request.
  2. esmeralda catalog resolve (including --check in CI) and catalog show read only the snapshot. They never open a network socket, and the same tree always gives the same bytes. The resolved catalog lists each snapshot source as {name, type, snapshot, sha256}, so a changed snapshot shows up in its diff.
uv run esmeralda catalog sources --env dev                         # sources, capabilities, snapshot path, sha256, entries
uv run esmeralda catalog fetch --env dev --source all --dry-run    # what a fetch would change; writes nothing
uv run esmeralda catalog fetch --env dev --source my-cmdb          # refresh one snapshot (exit 2: source unreachable)
uv run esmeralda catalog diff --env dev                            # findings for review (exit 3 when there are any)
uv run esmeralda catalog diff --env dev --live                     # also live vs snapshot (network, never written)
uv run esmeralda catalog show --env dev --provenance               # where each entry and external field came from
uv run esmeralda catalog show --env dev --inventory                # discovered entries, never compiled
  • Normalized and reproducible. A fetch sorts entries by id and mapping keys, drops volatile fields (etag, createTime, updateTime, ...) and writes no timestamp: fetching the same live state twice gives the same bytes. Two entries with the same id or derived name fail the fetch; they are never ordered or suffixed.
  • No environment literals. Project ids and numbers, the organization id, the domain and the region become placeholders: {project:<alias>}, {project_number:<alias>}, {org}, {domain}, {region} (aliases are layer-1 output names; units substitute them back at apply time, as iap-egress does for {domain}). A snapshot that still holds a raw 12-digit project number, an organization id, an email or IAM member, or a token-like string is refused by catalog fetch and by esmeralda guard.
  • Missing snapshot. An enabled source without its snapshot fails the resolve with the catalog fetch command to run. With options: { optional: true } it is a warning and an empty layer instead, until a catalog file adopts one of its entries: then the snapshot is required.
  • Drift. catalog diff reports discovered entries no catalog file adopts, external values a catalog file shadows or environments/<env>.yaml overrides, source data that disagrees with the catalog files (label_mismatch, metadata_mismatch), hints a source offers (suggested_grant, never a grant), and optional sources without a snapshot; --live adds the entries that changed in the live source since the snapshot and, for Agent Registry, the missing entries Esmeralda registers that the live registry doesn't list.
  • Drift in verify. esmeralda verify --env <env> runs a catalog-drift step: the same findings (offline, plus live for each enabled snapshot source), counted per kind, with the top findings and the catalog diff command to run. It only warns by default; set policy.verify.catalog_drift: fail (in policy.yaml or environments/<env>.yaml) or pass --catalog-strict to make a finding fail verify. An unreachable source is a notice, never a failure. With no external source enabled (the shipped sources.yaml) the step passes at once; --skip-catalog skips it.

An adapter for a live system subclasses SnapshotSource and implements fetch() (plus layer_from_entries() when its entries aren't {id, name, inventory}, and placeholders()):

from esmeralda.catalog import Placeholders, SnapshotSource, SourceUnreachable, register_source

@register_source("my_cmdb")
class CmdbSource(SnapshotSource):
    CAPABILITIES = {"inventory": ["*"], "targets": ["description"]}

    def placeholders(self) -> Placeholders:
        return Placeholders(domain=..., projects={"apps": ...})   # from layer outputs

    def fetch(self) -> list[dict]:
        try:
            items = read_export(self.spec.get("options", {}))     # your client, read-only
        except OSError as exc:
            raise SourceUnreachable(f"{self.name}: {exc}") from exc
        return [
            {"id": item.id, "name": item.name,
             "inventory": {"kind": "http", "description": item.description,
                           "deploy": {"endpoint": item.url}, "registry": {"id": item.id}}}
            for item in items
        ]

The repository's sources.yaml keeps every network source disabled and commits no real snapshot; the tests use synthetic snapshots under packages/esmeralda/tests/fixtures/catalog_sources/, and the golden multi-source catalog under packages/esmeralda/tests/fixtures/catalog_golden/ shows every source type merged together (see 2.7 §4).

Project labels (project_labels)

Attribution metadata from the labels of the environment's projects, never authorization.

  • Fetch. catalog fetch --env <env> --source project-labels reads the projects named by the <alias>_project_id outputs of layer-1-projects (or the options.projects list of {alias, output: <unit>:<output>}) with a read-only gcloud projects describe. The snapshot has one entry per project, keyed by its alias (gateway, mcps, ...), with only the configured label keys (team_label, default team; cost_center_label, default cost-center). Project ids, numbers, the parent and every other label are dropped.
  • Resolve. Each labelled project goes into teams.<team>.projects of the catalog team its team label maps to (team_map maps label values to catalog teams; same name by default), unless the catalog files already declare that team's projects or the project. An inventory entry another source reported without an owner_team gets the team of the project in its runtime_resource ({project:<alias>}); list project-labels after the inventory sources. .resolved/<env>.json then carries attribution.project_teams rows ({project, team}, the key to attribute project-level infrastructure cost from the billing export) and the field provenance.
  • Labels never create teams, never extend cost_centers and never override catalog files. Anyone with project IAM can edit a label outside code review, so a disagreement is a label_mismatch finding: a label that maps to no catalog team, a cost-center label (through cost_center_map) outside the team's declared cost_centers, a project the catalog files give to another team, a declared owner_team that differs from its project's label. policy.attribution.label_mismatch makes findings fail the resolve (fail, the default) or print them as warnings (warn, accepted only in flag_environments). catalog diff lists them either way.
  • catalog show --env <env> --provenance lists the teams with their projects and where each came from.
- name: project-labels
  type: project_labels
  options:
    team_label: team
    cost_center_label: cost-center
    team_map: { appdev-tools: platform }                      # label value -> catalog team
    cost_center_map: { central-developer-tools: cc-platform } # label value -> catalog cost centre

Agent Registry (agent_registry)

Discovered inventory, never authorization.

  • Fetch. catalog fetch --env <env> --source agent-registry lists the agents, mcpServers and endpoints of the Agent Registry of the projects in options.projects (aliases of the layer-1 <alias>_project_id outputs; default [governance]) with read-only gcloud alpha agent-registry ... list, in options.location (default: the environment's region). That includes what the runtimes register automatically: Agent Runtime engines, Cloud Run services and GKE workloads registered as agents or MCP servers. Each entry keeps its registry id, a catalog name, the kind (a2a, mcp, http, or model for hosts in options.model_hosts), the description, the first https interface as deploy.endpoint, the interfaces, the A2A skills (informational, never a tools grant) and the runtime resource. Project ids and numbers, the region and the entry point domain become placeholders; runtime identities are dropped.
  • No loop. What Esmeralda registers itself is excluded at fetch time: entries backed by an Agent Registry service of catalog/.resolved/<env>.json (deployed targets, external_targets, google_apis), the runtime's own core-gapi-services* entries and the Agent Runtime engines of the deployed agents (their units' engine_id). Google's global agents (urn:agent:googleapis.com:*) are skipped by default (options.exclude).
  • Names. The catalog name is the registry service id, or the display name in lower case with - separators. options.names maps a registry id to another name. An invalid name or two entries with the same name fail the fetch; names never get an automatic suffix.
  • Resolve. Every entry is a discovered inventory entry: listed by catalog show --inventory and as discovered by catalog diff, never compiled (no IAM, no Agent Gateway policy, no registry write, no allowlist). To put one under enforcement, a team adds a catalog file with deploy.registry: { source: agent-registry, id: <registry id> } and its callers, reviewed like any other grant (see below). An inventory entry named like an unpinned catalog target fails the resolve, and so does a pin whose id the snapshot doesn't hold. With project_labels listed after it, discovered entries get the owner_team of their runtime project.
  • Drift. catalog diff --env <env> --live also lists missing entries: the ones .resolved/<env>.json registers that the live registry doesn't list.
- name: agent-registry
  type: agent_registry
  options:
    projects: [governance, ai_coe_agents, cx_agents, mcps]
    names: { "<registry id>": pricing-helper }

Adopting a discovered agent

An agent another team deployed on Agent Runtime registers itself in Agent Registry, so it shows up as discovered inventory after a catalog fetch. Its lifecycle in the catalog:

State What the catalog holds What the Agent Gateway does
discovered an inventory entry in the snapshot nothing is compiled; nobody is granted
adopted a catalog file pins the registry id a governance registry entry for the engine, with an empty policy
granted the catalog file lists callers exactly those callers may call the agent through the gateway
# catalog/teams/ai-coe/agents/resale-pricing.yaml (synthetic)
schema: esmeralda.catalog
schema_version: 1
name: resale-pricing
kind: a2a
owner_team: ai-coe
deploy:
  managed: false
  registry: { source: agent-registry, id: "urn:agent:projects-{project_number:ai_coe_agents}:projects:{project_number:ai_coe_agents}:locations:{region}:aiplatform:reasoningEngines:5550001" }
callers:
  support-assistant: {}
  • Fields. The snapshot fills deploy.endpoint, runtime, runtime_resource and description when the file leaves them unset. A field the file sets must equal the registry's value (strict), except description, where the file wins. A pinned id missing from the snapshot fails the resolve: re-fetch, or remove the adoption.
  • Why Esmeralda registers the agent again. Agent Runtime registers an engine in the Agent Registry of the engine's own project, but the Agent Gateway reads only the governance registry (layer 4), so a policy on that auto-registered entry would never be enforced. An adopted Agent Runtime agent therefore compiles into adopted_targets in .resolved/<env>.json: the iap-egress unit registers an agent entry in the governance registry (service id: the target name; the description names the adopted registry id) on URLs derived only from the engine's runtime_resource: the Vertex AI REST paths of that engine (.../reasoningEngines/<id>/, :query, :streamQuery, for v1 and v1beta1). The registry matches the longest URL prefix, so these paths win over the host-level {region}-aiplatform Google API entry for that engine only, and the entry's policy is iap_egress.agents[<name>]: exactly the listed callers, written and read back by the same per-entry script as every other target, and checked by esmeralda verify (registry-egress), which also checks the entry is registered on exactly those URLs. Any other registry entry still holds no policy. A new entry takes a few minutes to reach the gateway: until then, calls to the engine still match the host-level entry.
  • An adopted agent as a caller. When a target lists the adopted agent as a caller, its principal is derived from the runtime resource (a pure function: the engine's Agent Identity, principal://{trust_domain:<alias>}/resources/aiplatform/projects/{project_number:<alias>}/locations/<location>/reasoningEngines/<id>; the iap-egress unit resolves the trust domain like the agent units do, org_id included). It goes onto that target's gateway list and into principal_teams (with the adopted target's owner_team), so every principal the gateway lets through stays attributable. An adopted agent may call external and adopted targets; a deployed target would also need IAM grants and its caller allowlist, which adopted agents don't get yet, so listing one there fails the resolve.
  • Supported runtimes. Only agent_runtime entries compile. Adopting a cloud_run or gke entry fails the resolve with "not supported for adoption yet", so nothing is granted silently; Cloud Run and GKE adoption are planned. A pinned entry the source reports without a runtime (a manual registration, a CMDB endpoint) compiles as an external target, like an unpinned one. An example: true adoption compiles nothing.
  • Adopted agents as callers: external and adopted targets only. Listing an adopted agent as a caller of a deployed target (an Esmeralda MCP server or agent) fails the resolve for now.
  • Removing an adoption deletes the governance entry and its policy on the next iap-egress apply; the engine falls back to the host-level entry, where calling it still needs Agent Runtime IAM on its project.
  • Future simplification. With a management boundary (the governance project as management project, the agent projects as members), auto-registered engines would roll up into the governance registry, and the adoption could grant on the auto-registered entry itself instead of registering a second one.

Backstage (backstage)

Discovered inventory and team metadata from a Backstage software catalog, never authorization. It is the reference adapter for enterprise catalogs: a CMDB or API Hub adapter can copy its shape.

  • Fetch. catalog fetch --env <env> --source backstage reads the Backstage Catalog API (GET <base_url>/api/catalog/entities/by-query, cursor pagination, Python standard library only) with the filters of options.filters (default: the options.component_types Components, APIs, Groups and annotated Resources). options.file reads a JSON export instead (a list of entities, or {"items": [...]}), so it works fully offline. base_url must be https:// (http:// only for localhost, for a local test instance).
  • Token. A Backstage external-access token scoped to catalog.entity.read, read at fetch time from options.token_env (default ESMERALDA_BACKSTAGE_TOKEN: the environment, or ~/.config/esmeralda/env for ESMERALDA_* names) or options.token_secret (a Secret Manager version, projects/{project:<alias>}/secrets/<secret>/versions/<v>). Without either, the request is anonymous. The token is sent only to base_url (never on a redirect) and never written to a snapshot, sources.yaml, a log or an error message.
  • Mapping.
Backstage Esmeralda
Component with spec.type in component_types (default agent, mcp-server, service) inventory entry: kind from the esmeralda.dev/kind annotation (else agent → a2a, mcp-server → mcp, service → http), owner_team from spec.owner, description, system, deploy.endpoint from esmeralda.dev/endpoint or the API it provides. spec.lifecycle: experimental is skipped unless include_experimental: true
API endpoint of the Component that provides it; an API no Component provides, with esmeralda.dev/endpoint, is an inventory entry (http, or its esmeralda.dev/kind). Definitions are never copied
Resource with esmeralda.dev/kind inventory entry, like a standalone API
System the system tag (descriptive, never enforced)
Group a reference to a team the catalog files declare (esmeralda.dev/team, options.team_map, else the group name); fills the team profile description, oncall (esmeralda.dev/oncall) and contacts (esmeralda.dev/contacts; emails are dropped) where team.yaml leaves them unset
consumesApis, dependsOn never callers: catalog diff lists them as suggested_grant for a human to declare
identity annotations ignored: identities come from catalog files and unit outputs only
  • Names. The catalog name is the entity's metadata.name; options.names maps an entity ref to another name. Two entities with the same name fail the fetch; names never get a suffix.
  • Resolve. Every entity is a discovered inventory entry, never compiled. To adopt one, a catalog file adds backstage: { source: backstage, ref: Component:default/<name> } (refs compare case-insensitively). The adopted target takes description and system (the catalog file wins) and, unless a unit deploys it, deploy.endpoint (must agree); kind and owner_team must agree. Callers still come from the file.
  • Teams. Backstage never creates teams and never extends cost_centers. A Group, or an owner, that maps to no catalog team is a metadata_mismatch finding, governed by policy.attribution.label_mismatch like project labels.
- name: backstage
  type: backstage
  options:
    base_url: https://backstage.example.com
    token_env: ESMERALDA_BACKSTAGE_TOKEN
    component_types: [agent, mcp-server, service]
    team_map: { order-ops-squad: ai-coe }        # Backstage group -> catalog team
    names: { "Component:default/pricing-helper": pricing-helper-bs }
    placeholders: [domain]                      # entry point domain in endpoints -> {domain}
# teams/ai-coe/agents/pricing-helper.yaml (synthetic): one catalog entry joins two sources
name: pricing-helper
kind: a2a
owner_team: ai-coe
deploy:
  managed: false
  endpoint: https://pricing-helper.example.com/a2a
  registry: { source: agent-registry, id: "<registry id>" }
backstage: { source: backstage, ref: Component:default/pricing-helper }
callers:
  support-assistant: {}

To try it without a Backstage instance, point options.file at a JSON export (the tests use the synthetic packages/esmeralda/tests/fixtures/catalog_sources/backstage/entities.json). For a manual smoke test against a local instance, run the Backstage example app in a container, register a few catalog-info.yaml entities with the annotations above, set base_url: http://localhost:7007 and run catalog fetch --source backstage --dry-run.

Export (later). esmeralda catalog export --env <env> --format backstage (Esmeralda as the producer: one catalog-info.yaml Component per target, with read-only annotations for the gateway, callers and who pays, for Backstage to ingest from a URL location) is planned, not implemented.