Governed capabilities

Prev Next

Publish business capabilities with enterprise keys <resourceType>.<operation> and RBAC permissions <resourceType>:<operation> so Role Assistants and Enterprise MCP use governed keys.

Prerequisites

Where it lives

Location Purpose
Datasource JSON capabilities describes operations; exposed defines the response contract; root openapi binds vendor operations
Upload/compiler Dedupes into enterprise capability keys online
RBAC rbac.yaml permissions match capability names

How to set

  1. Complete field mappings — capabilities without metadata produce empty AI context.

  2. Configure exposure and root OpenAPI bindings on datasource JSON (fragment):

{
  "exposed": {
    "schema": { "externalId": "metadata.externalId", "name": "metadata.name" },
    "profiles": { "list": ["externalId", "name"] }
  },
  "openapi": {
    "enabled": true,
    "autoRbac": true,
    "operations": {
      "list": {
        "operationId": "listCompanies",
        "method": "GET",
        "path": "/crm/v3/objects/companies"
      }
    }
  }
}

With root openapi.autoRbac: true, permissions default to <resourceType>:<operation> when operations lack explicit scopes.

  1. Repair expose flags when scaffold left datasources unpublished:
aifabrix repair <systemKey> --expose --dry-run
aifabrix repair <systemKey> --expose
aifabrix validate <systemKey>
  1. Upload:
aifabrix upload <systemKey>
aifabrix deploy <systemKey> --probe
aifabrix show <systemKey> --online
  1. Test execution path:
aifabrix test-integration <systemKey>
aifabrix datasource test-e2e <datasourceKey> --app <systemKey>
  1. Align RBAC — Configure roles and permissions permission names match exposed keys.

  2. Document capability metadata on each datasource — business descriptions and Role Assistant placeholders:

{
  "capabilities": [
    {
      "key": "list",
      "description": "List customer records with governance filters applied.",
      "riskLevel": "low",
      "approvalRequired": false
    },
    {
      "key": "update",
      "description": "Update customer attributes in the external CRM.",
      "riskLevel": "high",
      "approvalRequired": true
    }
  ]
}
Field Integrator note
description Non-empty for every exposed operation — missing descriptions produce a weakCapabilityCoverage informational finding
riskLevel low | medium | high | critical — signals certification and Role Assistant review
approvalRequired When true, document expected approval path in business concept pages

Capabilities with riskLevel: high or critical and approvalRequired not set to true produce a highRiskCapabilityWithoutApproval warning. These metadata flags do not implement an approval workflow; configure and prove that workflow separately.

Before publication, check that each capability description matches the exact operation key, input fields, write profile and execution shape. Exercise the named operation with permitted and denied callers; for writes, read back the business fields it promises to change. Keep the operation outcome and the read-back outcome separately: a successful vendor mutation does not prove that the platform's stored projection is current. If the connection fails after a write, inspect the vendor state before retrying; an unknown outcome is not a confirmed failure. A dimension grant controls row scope; the caller still needs permission to invoke the operation. Capability order is validation metadata for a planned shared resolver; current routing does not select an operation by that rank.

Defaults and examples

Practice Reason
Business keys (customer:search) Auditors understand logs
One outcome per capability Easier certification
Avoid vendor names in keys Survives API swaps
E2E with declared write scenarios before certify Proves execution, not schema only

Custom transforms belong in CIP execution — capabilities remain the governed entry point.

Root identity fields required before exposed compiles:

Field Capability impact
resourceType Permission prefix (customer:read)
entityType Execution/sync path
externalId Governed search joins
fieldMappings Agent metadata trust

Authoring an upsert candidate

aifabrix datasource capability upsert <file-or-key> --dry-run --json previews composition from existing create/update capabilities, business identity and an exact lookup in the materialized vendor contract. Static success means a candidate was authored, not that writes are safe. Validate the resulting manifest and prove identity lookup, first write, repeated write without a duplicate, and cleanup through the full datasource E2E scenario. Do not filter that proof to the single upsert operation. Retain source limitations until the actual production transport and caller scope pass.

Validate

An ordinary upload qualifies a candidate; deploy promotes it. For a running package that changes, follow the explicit replacement preview and confirmation in Lifecycle, download, and repair. Neither interface publication nor metadata risk flags grant a caller permission to execute.

aifabrix validate <systemKey>
aifabrix upload <systemKey> --probe
aifabrix verify-operations <systemKey>
aifabrix verify-trust <systemKey>

Common mistakes

Mistake Fix
Exposed without field mappings Complete mappings first
Upload skipped after JSON edits upload --probe
Raw OpenAPI paths to AI Use compiled capability keys via Enterprise MCP
RBAC names mismatch Prefix with datasource resourceType

Limits

Compiler output and online capability keys depend on upload environment and schema version — verify with show --online after publish.

Each capability assumes datasource root fields are valid — key, displayName, systemKey, entityType, resourceType, primaryKey, and indexed externalId. autoRbac generates permission names from resourceType — mismatched catalog keys break governance even when validate passes. Run verify-trust after exposed changes — agent metadata tests depend on field mappings, not capability names alone. Use show --online to confirm compiled capability keys match rbac.yaml permission strings before verify-governance.

MCP exposure reuses compiled capability keys. Local exposure settings alone do not prove that the published tool enforces Operational Trust.

Prefer one governed outcome per resourceType operation so certification logs remain auditable; bundle complex vendor calls behind CIP when multiple HTTP steps are required.

Use the same resourceType for entities of the same business grain. Within one system, an authority table and view contributors can share that type, but their capability keys must be distinct; collisions are rejected. Do not invent a different resource type just to avoid a capability collision.

Changing exposed without re-upload leaves Enterprise MCP tools stale — always pair JSON edits with upload --probe and show --online before verify-trust.

Capability names visible to operators come from displayName and compiled keys — keep business vocabulary consistent across datasources sharing related resourceType prefixes.

Operations certification requires live vendor mutation when write scenarios are enabled — read-only sandboxes may pass trust while failing operations until CRUD-capable tenants are provisioned.

Treat autoRbac as a convenience default — explicit permission names in rbac.yaml remain the audit source of truth after first upload.