Skip to main content

D-06 Skill Loader

Brick D: Tools, skills, plugins, MCP, connectors. French version: D-06-skill-loader

1. Role and responsibilities​

Loads a skill into an agent context on demand, refusing any unsigned or blocked skill.

  • Check signature, status, runtime compatibility
  • Return instructions and resources
  • Check declared permissions

2. Position in the architecture and interactions​

  • Callers: Loop Controller, Context Manager (E-09).
  • Execution path: Synchronous.
  • Every interaction goes through the Control Plane API v1 (/v1) behind the API Gateway (D-14).

3. Open source component and developed part​

  • Open source: none (to develop)
  • Developed: Fully developed (progressive loading).
  • External integration through an adapter eai/integrations/<system>.py with an in-process fallback when the URL is not configured.

4. Data model​

Tables (schema eai, tenant_id RLS):

  • eai.skills

Common columns: id uuid, tenant_id uuid NOT NULL, created_at, updated_at; RLS policy current_setting('app.tenant_id', true)::uuid.

5. Contract​

  • Applied contract: skill-manifest
  • JSON Schema: contracts/v1/skill-manifest.schema.json
  • Key fields: spec.permissions, spec.signature, spec.compatible_runtimes
  • Validation: POST /v1/contracts/{name}/validate; manifest apply: POST /v1/manifests/apply.

6. API endpoints​

  • GET /v1/skills/{name}/load

Request GET /v1/skills/{name}/load:

{}

Response:

{
"name": "invoice-reader",
"version": "1.0.3",
"instructions": "# Invoice reader...",
"resources": [
"templates/invoice.json"
],
"digest": "sha256:ab12..."
}

7. SDK examples​

Python:

from enterprise_ai import EnterpriseAI

client = EnterpriseAI(base_url="<control-plane-url>", api_key="eai_xxx_secret")
skill = client.skills.load("invoice-reader")

TypeScript:

import { EnterpriseAI } from "@enterprise-ai/sdk";

const client = new EnterpriseAI({ baseUrl: "<control-plane-url>", apiKey: process.env.EAI_API_KEY });
const skill = await client.skills.load("invoice-reader");

Java:

EnterpriseAIClient client = EnterpriseAIClient.builder()
.baseUrl("<control-plane-url>")
.apiKey(System.getenv("EAI_API_KEY"))
.build();
Skill skill = client.skills().load("invoice-reader");

Go:

c, _ := eai.NewClient(eai.WithBaseURL("<control-plane-url>"), eai.WithAPIKey(os.Getenv("EAI_API_KEY")))
skill, _ := c.Skills.Load(ctx, "invoice-reader")

8. Configuration​

  • Environment variables: EAI_DATABASE_URL
  • Helm values keys: sandbox.enabled, controlPlane.config

9. Security controls​

  • Refusal 403 skill_unsigned or skill_blocked
  • Every request carries the tenant resolved from the credential; PostgreSQL RLS
  • Every mutation and policy decision writes a hash-chained audit event

10. Observability​

  • Prometheus metrics: eai_skill_loads_total{result}
  • Traces: OpenTelemetry spans with GenAI semantic conventions (gen_ai.operation.name, gen_ai.agent.id, gen_ai.tool.name), attributes eai.tenant_id, eai.run_id, traceparent propagation.
  • Audit actions: skill.load

11. FinOps units​

  • Instruction tokens counted in the context.
  • Emitted as Usage Event (POST /v1/finops/usage) with tenant, project, agent and run.

12. Failure modes and resilience​

  • Cache by digest, invalidated on block
  • Normalized errors (error envelope, message_i18n en/fr)

13. Standalone adoption (client of a client)​

  • enterprise_ai.skills.
  • SDK: enterprise_ai.tools / mcp / skills / plugins / connectors / channels
  • Minimal deployment: Helm chart with controlPlane.enabled=true and PostgreSQL; disabled external components use their in-process fallback.

14. Acceptance tests​

  1. Unsigned skill -> 403
  2. Blocked skill: refused on next load
  3. Cross-tenant access refused
  4. Error returned in fr with Accept-Language: fr