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 resolvemerges 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, integerschema_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/<env>.yaml overrides"]
O --> D["policy defaults"]
D --> V["validate: schema + references"]
V --> R[".resolved/<env>.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"]
- Merge. Sources are merged in the order
sources.yamllists them. In thefilessource, 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. - Override.
environments/<env>.yamlis applied last: maps merge, lists replace, andnulldeletes a key (for example,callers: { test-vm: null }removes the test VM in one environment). - 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.
-
Compile. Deployed targets (kind
mcp,a2aoradkwith adeploy.unit) become thecatalogmap incatalog/.resolved/<env>.json:kind,unit,token,probe, an optionaltimeout, and optionalcallers(agents, which getrun.invoker/aiplatform.useras their Agent Identity principal, andservice_accountcallers, which get them as their service account). Eachinfrastructure/live/<env>/env.yamldecodes 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-guardsfails when they are stale. -
Compile the Agent Gateway lists. The same callers also become
iap_egressin the same file: the per-targetroles/iap.egressormember lists the Layer 5iap-egressunit writes on each Agent Registry entry (agentsfora2atargets,mcp_serversformcptargets). 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 aservice_accountcaller contributes itsref.env.yamldecodes the lists ascatalog_iap_egress, and theiap-egressunit 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
callersentry 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 itsdependencyblock and itsidentity_refsentry in theiap-egressunit (and in each MCP service unit, which grants itrun.invokeras its principal);make test-guardschecks 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 keepsrun.invokeron 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 theiap-egressunit doesn't map (anything other thanlayer-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_identityblock, which adds one shared member to targets with an agent caller; this repository doesn't use it.) -
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 intoexternal_targets: one Agent Registry entry per target, which the Layer 5iap-egressunit creates (env.yamldecodes it ascatalog_external_targets). Its callers compile intoiap_egresslike any other target, so only they can reach it through the Agent Gateway:kindRegistry entry iap_egressgrouphttpendpoint ( HTTP_JSON, no spec)endpointsmodelon a non-Google hostendpoint endpointsmcpMCP server ( JSONRPC, no tool spec)mcp_serversa2aagent, 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
endpointis an exacthttps://URL. Environment-specific parts are placeholders theiap-egressunit 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 asgemini-flashon 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 ingoogle_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.tokenrecords 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 asexternal/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 declarellm-gateway(kind: http,https://apigee.{domain}/llm,serving.token: id) with both agents as callers. Its callers are also the proxy's allowlist (Apigeellm-gateway), andmake test-guardsfails if it is declared where the capability is off, or missing where it is on. - Verification.
esmeralda verify(stepregistry-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 toexternal-probe.<domain>reaches the entry point and gets its no-route404; any other agent gets the gateway's403.
The registry root never holds a
roles/iap.egressorbinding: 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_apisin.resolved/<env>.json(env.yamldecodes it ascatalog_google_apis): one Agent Registry entry per API at least one deployed agent may reach, keyed by its service id, withurl,protocol_binding,description(see 6c),grantandcallers.- Names come from the resolver's known-hosts table (
esmeralda.catalog.GOOGLE_APIS): real, serving hostnames only, such asaiplatform(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 pinGOOGLE_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 theiap-egressunit to each declaring agent's Agent Identity; they're iniap_egress.endpointsunder the same key. No other agent can reach them. - Registration: layer 4 registers each entry as
https://<host>andhttps://<host>:443(gRPC clients sendhost: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.comhosts) 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>.jsonasdescription:- Google APIs: the API's
descriptionin the known-hosts table, which names the client that calls it (for examplebigquerystorage: the BigQuery Agent Analytics plugin'sAppendRowswrites). - MCP servers, A2A agents and
managed: falsetargets: the target'sdescription, 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-egressunit and the MCP and agent units pass it togoogle_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 everygoogle_agent_registry_serviceresource sets one. - Hostnames. The Agent Registry matches exact hostnames (no wildcards), so
-
Compile verified attribution. The same callers compile into an
attributionblock: theprincipal_teamsrows (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, orflagin the environments listed inflag_environments) anddeclared_mismatch(rejectorbill_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:
filesmust 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), thecallerssection, identities,policy, teams and theircost_centers,google_apis,user_credential,deploy.unit,serving,models,gatewayandobservability.environments/<env>.yamloverrides 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.fieldsinsources.yamlcan 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
inventorysection 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,endpointincluded), 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.
strictfields (kind,owner_team,deploy.endpoint,runtime,runtime_resource,registry.id) must agree across sources, otherwise the resolve fails and names both origins.firstfields (description,system,registry.skills, profiledescription/contacts/oncall) keep the earliest value (files first) and record the loser asshadowed. To override a strict external value, useenvironments/<env>.yaml. - Provenance and determinism. The resolved catalog (
--format json) carries aprovenancemap: entry-level for every entry, field-level for each field an external source contributed or shadowed. When an external source contributed,.resolved/<env>.jsonalso getsprovenanceandinventory_summary, so a reviewer sees which source changed a compiled value; for a files-only catalog both are omitted. Sources merge insources.yamlorder 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:
esmeralda catalog fetchcalls 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.snapshotchanges the path). The snapshot is committed and reviewed like any other catalog change, so every external change reaches the catalog through a pull request.esmeralda catalog resolve(including--checkin CI) andcatalog showread 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, asiap-egressdoes 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 bycatalog fetchand byesmeralda guard. - Missing snapshot. An enabled source without its snapshot fails the resolve with the
catalog fetchcommand to run. Withoptions: { 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 diffreports discovered entries no catalog file adopts, external values a catalog file shadows orenvironments/<env>.yamloverrides, 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;--liveadds the entries that changed in the live source since the snapshot and, for Agent Registry, themissingentries Esmeralda registers that the live registry doesn't list. - Drift in
verify.esmeralda verify --env <env>runs acatalog-driftstep: the same findings (offline, plus live for each enabled snapshot source), counted per kind, with the top findings and thecatalog diffcommand to run. It only warns by default; setpolicy.verify.catalog_drift: fail(inpolicy.yamlorenvironments/<env>.yaml) or pass--catalog-strictto make a finding fail verify. An unreachable source is a notice, never a failure. With no external source enabled (the shippedsources.yaml) the step passes at once;--skip-catalogskips 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-labelsreads the projects named by the<alias>_project_idoutputs oflayer-1-projects(or theoptions.projectslist of{alias, output: <unit>:<output>}) with a read-onlygcloud projects describe. The snapshot has one entry per project, keyed by its alias (gateway,mcps, ...), with only the configured label keys (team_label, defaultteam;cost_center_label, defaultcost-center). Project ids, numbers, the parent and every other label are dropped. - Resolve. Each labelled project goes into
teams.<team>.projectsof the catalog team itsteamlabel maps to (team_mapmaps 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 anowner_teamgets the team of the project in itsruntime_resource({project:<alias>}); listproject-labelsafter the inventory sources..resolved/<env>.jsonthen carriesattribution.project_teamsrows ({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_centersand never override catalog files. Anyone with project IAM can edit a label outside code review, so a disagreement is alabel_mismatchfinding: a label that maps to no catalog team, acost-centerlabel (throughcost_center_map) outside the team's declaredcost_centers, a project the catalog files give to another team, a declaredowner_teamthat differs from its project's label.policy.attribution.label_mismatchmakes findings fail the resolve (fail, the default) or print them as warnings (warn, accepted only inflag_environments).catalog difflists them either way. catalog show --env <env> --provenancelists 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-registrylists theagents,mcpServersandendpointsof the Agent Registry of the projects inoptions.projects(aliases of the layer-1<alias>_project_idoutputs; default[governance]) with read-onlygcloud alpha agent-registry ... list, inoptions.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, ormodelfor hosts inoptions.model_hosts), the description, the firsthttpsinterface asdeploy.endpoint, the interfaces, the A2A skills (informational, never atoolsgrant) 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 owncore-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.namesmaps 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
inventoryentry: listed bycatalog show --inventoryand asdiscoveredbycatalog 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 withdeploy.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. Withproject_labelslisted after it, discovered entries get theowner_teamof their runtime project. - Drift.
catalog diff --env <env> --livealso listsmissingentries: the ones.resolved/<env>.jsonregisters 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_resourceanddescriptionwhen the file leaves them unset. A field the file sets must equal the registry's value (strict), exceptdescription, 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_targetsin.resolved/<env>.json: theiap-egressunit 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'sruntime_resource: the Vertex AI REST paths of that engine (.../reasoningEngines/<id>/,:query,:streamQuery, forv1andv1beta1). The registry matches the longest URL prefix, so these paths win over the host-level{region}-aiplatformGoogle API entry for that engine only, and the entry's policy isiap_egress.agents[<name>]: exactly the listed callers, written and read back by the same per-entry script as every other target, and checked byesmeralda 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>; theiap-egressunit resolves the trust domain like the agent units do,org_idincluded). It goes onto that target's gateway list and intoprincipal_teams(with the adopted target'sowner_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_runtimeentries compile. Adopting acloud_runorgkeentry 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. Anexample: trueadoption 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-egressapply; 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 backstagereads the Backstage Catalog API (GET <base_url>/api/catalog/entities/by-query, cursor pagination, Python standard library only) with the filters ofoptions.filters(default: theoptions.component_typesComponents, APIs, Groups and annotated Resources).options.filereads a JSON export instead (a list of entities, or{"items": [...]}), so it works fully offline.base_urlmust behttps://(http://only forlocalhost, for a local test instance). - Token. A Backstage external-access token scoped to
catalog.entity.read, read at fetch time fromoptions.token_env(defaultESMERALDA_BACKSTAGE_TOKEN: the environment, or~/.config/esmeralda/envforESMERALDA_*names) oroptions.token_secret(a Secret Manager version,projects/{project:<alias>}/secrets/<secret>/versions/<v>). Without either, the request is anonymous. The token is sent only tobase_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.namesmaps 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
inventoryentry, never compiled. To adopt one, a catalog file addsbackstage: { source: backstage, ref: Component:default/<name> }(refs compare case-insensitively). The adopted target takesdescriptionandsystem(the catalog file wins) and, unless a unit deploys it,deploy.endpoint(must agree);kindandowner_teammust 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 ametadata_mismatchfinding, governed bypolicy.attribution.label_mismatchlike 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.