ai-capability-framework 1.0.0-rc.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +97 -103
- package/CODE_OF_CONDUCT.md +11 -13
- package/CONTRIBUTING.md +40 -43
- package/GOVERNANCE.md +34 -35
- package/README.md +99 -63
- package/ROADMAP.md +12 -12
- package/SECURITY.md +15 -15
- package/dist/audit/ledger.d.ts.map +1 -1
- package/dist/audit/ledger.js +2 -1
- package/dist/audit/records.d.ts.map +1 -1
- package/dist/audit/records.js +2 -1
- package/dist/audit/types.d.ts +4 -1
- package/dist/audit/types.d.ts.map +1 -1
- package/dist/aws/dynamodb-stores.d.ts +2 -7
- package/dist/aws/dynamodb-stores.d.ts.map +1 -1
- package/dist/aws/dynamodb-stores.js +56 -5
- package/dist/aws/testing.d.ts.map +1 -1
- package/dist/aws/testing.js +9 -0
- package/dist/cli.d.ts +6 -6
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +77 -7
- package/dist/evals-live/index.d.ts +2 -2
- package/dist/evals-live/index.d.ts.map +1 -1
- package/dist/evals-live/index.js +1 -1
- package/dist/evals-live/live-eval-runner.d.ts +49 -1
- package/dist/evals-live/live-eval-runner.d.ts.map +1 -1
- package/dist/evals-live/live-eval-runner.js +246 -4
- package/dist/evals-live/types.d.ts +62 -9
- package/dist/evals-live/types.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/runtime/actions.d.ts +2 -0
- package/dist/runtime/actions.d.ts.map +1 -1
- package/dist/runtime/actions.js +200 -55
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/stores.d.ts +2 -7
- package/dist/runtime/stores.d.ts.map +1 -1
- package/dist/runtime/stores.js +12 -0
- package/dist/runtime/types.d.ts +25 -6
- package/dist/runtime/types.d.ts.map +1 -1
- package/docs/action-lifecycle.md +38 -32
- package/docs/adapter-roadmap.md +51 -49
- package/docs/adapters.md +14 -15
- package/docs/ai-sdk-runtime.md +36 -39
- package/docs/anthropic-runtime.md +29 -32
- package/docs/api/public-api-policy.md +59 -0
- package/docs/api.md +354 -371
- package/docs/architecture/current-state.md +28 -31
- package/docs/audit/index.md +29 -29
- package/docs/aws/cloudwatch-telemetry.md +5 -7
- package/docs/aws/dynamodb-single-table.md +8 -9
- package/docs/aws/kms-redaction.md +5 -6
- package/docs/aws/overview.md +5 -5
- package/docs/aws/production-reference.md +13 -14
- package/docs/aws/step-functions-approval.md +7 -9
- package/docs/aws-runtime.md +24 -25
- package/docs/capability-manifests.md +17 -21
- package/docs/control-plane/overview.md +2 -2
- package/docs/control-plane.md +24 -27
- package/docs/controls/index.md +19 -22
- package/docs/core/capability-manifests.md +4 -5
- package/docs/core/entity-manifests.md +5 -5
- package/docs/eval-runner.md +29 -31
- package/docs/evalops.md +13 -14
- package/docs/evals/golden-tests.md +4 -5
- package/docs/evals/overview.md +3 -3
- package/docs/evals/replay-and-trace-to-golden.md +19 -20
- package/docs/evals.md +19 -20
- package/docs/evidence.md +22 -23
- package/docs/gemini-runtime.md +31 -33
- package/docs/getting-started/anthropic-quickstart.md +61 -0
- package/docs/getting-started/concepts.md +9 -10
- package/docs/getting-started/gemini-quickstart.md +62 -0
- package/docs/getting-started/installation.md +3 -3
- package/docs/getting-started/openai-quickstart.md +61 -0
- package/docs/getting-started/provider-neutral-quickstart.md +106 -0
- package/docs/getting-started/quickstart.md +2 -2
- package/docs/getting-started.md +23 -20
- package/docs/glossary.md +31 -48
- package/docs/governance/gate.md +28 -30
- package/docs/governance/impact-and-compatibility.md +2 -3
- package/docs/governance/index.md +53 -54
- package/docs/governance/lifecycle.md +4 -5
- package/docs/governance/overview.md +2 -3
- package/docs/governance/risk-compiler.md +4 -5
- package/docs/host-responsibilities.md +6 -8
- package/docs/implementation-notes/baseline-gaps.md +15 -18
- package/docs/index.md +21 -6
- package/docs/interoperability.md +9 -9
- package/docs/langchain-runtime.md +27 -31
- package/docs/live-evals.md +68 -32
- package/docs/mcp-server-runtime.md +36 -40
- package/docs/memory.md +35 -36
- package/docs/migration-0.1-to-1.0.md +14 -9
- package/docs/observability/overview.md +2 -3
- package/docs/observability-runtime.md +35 -39
- package/docs/openai-responses.md +36 -37
- package/docs/openai-runtime.md +41 -46
- package/docs/openai-walkthrough.md +24 -28
- package/docs/policy-broker.md +9 -10
- package/docs/provenance.md +30 -29
- package/docs/providers/anthropic.md +5 -5
- package/docs/providers/choose-a-runtime.md +37 -0
- package/docs/providers/conformance.md +14 -15
- package/docs/providers/gemini.md +5 -5
- package/docs/providers/mcp.md +2 -3
- package/docs/providers/openai.md +2 -2
- package/docs/providers/semantic-kernel.md +2 -2
- package/docs/providers.md +43 -38
- package/docs/public/license-exceptions.md +187 -0
- package/docs/public/npm-release-preflight.md +112 -0
- package/docs/public-framework/compatibility-policy.md +12 -13
- package/docs/public-framework/deprecation-policy.md +8 -8
- package/docs/public-framework/final-certification-matrix.md +104 -0
- package/docs/public-framework/license-decision.md +20 -0
- package/docs/public-framework/release-process.md +46 -16
- package/docs/public-framework/security-disclosure.md +4 -5
- package/docs/public-framework/v1-certification.md +102 -15
- package/docs/release.md +200 -122
- package/docs/runtime/action-lifecycle.md +3 -3
- package/docs/runtime/policy-broker.md +4 -4
- package/docs/runtime/runtime-overview.md +4 -5
- package/docs/runtime/tool-result-envelope.md +7 -7
- package/docs/runtime.md +90 -93
- package/docs/security/overview.md +4 -4
- package/docs/security/security-packs.md +24 -26
- package/docs/security/trust-taint-redaction.md +42 -47
- package/docs/semantic-kernel-runtime.md +35 -37
- package/docs/spec.md +95 -101
- package/docs/start-here.md +18 -20
- package/examples/01-basic-read-capability/README.md +3 -4
- package/examples/02-prepare-approve-commit/README.md +6 -6
- package/examples/03-multi-provider-tools/README.md +2 -2
- package/examples/04-mcp-server/README.md +4 -5
- package/examples/05-langchain-langgraph-bridge/README.md +4 -5
- package/examples/06-vercel-ai-sdk-bridge/README.md +5 -7
- package/examples/07-policy-broker-custom-auth/README.md +4 -4
- package/examples/08-aws-step-functions-approval/README.md +4 -5
- package/examples/09-security-packs-promptfoo/README.md +4 -4
- package/examples/10-trace-to-golden/README.md +2 -2
- package/examples/11-control-plane/README.md +4 -5
- package/examples/aws/README.md +5 -8
- package/examples/control-plane/README.md +8 -9
- package/examples/control-plane/fixtures/control-plane.seed.json +8 -32
- package/examples/control-plane/public/app.js +57 -18
- package/examples/control-plane/public/index.html +15 -6
- package/examples/control-plane/server.mjs +15 -3
- package/examples/eval-results/public.results.passing.json +6 -21
- package/examples/providers/ai-sdk-next/README.md +11 -8
- package/examples/providers/anthropic-claude/README.md +5 -6
- package/examples/providers/gemini/README.md +6 -6
- package/examples/providers/langchain-agent/README.md +3 -4
- package/examples/providers/langgraph-tool-node/README.md +7 -7
- package/examples/providers/mcp/README.md +8 -8
- package/examples/providers/provider-conformance/README.md +3 -3
- package/examples/providers/semantic-kernel-mcp/README.md +6 -6
- package/examples/providers/semantic-kernel-openapi/README.md +6 -7
- package/examples/runtime-support-billing/README.md +8 -9
- package/examples/runtime-support-billing/support-billing-runtime.mjs +8 -4
- package/examples/scheduling/capabilities/scheduling.availability.get.yaml +2 -2
- package/examples/scheduling/capabilities/scheduling.invite.prepare.yaml +2 -2
- package/examples/scheduling/capabilities/scheduling.invite.send.yaml +2 -2
- package/examples/scheduling/entities/AvailabilitySlot.yaml +2 -2
- package/examples/scheduling/entities/MeetingInvite.yaml +2 -2
- package/examples/scheduling/evals/scheduling.invite.prepare.valid.yaml +3 -1
- package/examples/semantic-kernel-mcp/README.md +11 -12
- package/examples/semantic-kernel-openapi/README.md +8 -8
- package/examples/support/capabilities/support.refund.commit_case.yaml +3 -3
- package/examples/support/capabilities/support.refund.prepare_case.yaml +2 -2
- package/examples/support/capabilities/support.ticket.get.yaml +2 -2
- package/examples/support/entities/Ticket.yaml +0 -1
- package/examples/support/eval-results/support.results.passing.json +3 -12
- package/examples/support/evals/support.refund.prepare_case.approval_required.yaml +3 -1
- package/examples/support/evals/support.refund.prepare_case.valid.yaml +3 -2
- package/examples/support/memory/support.agent.preferences.json +2 -6
- package/examples/support/openai/context.support_agent.json +1 -4
- package/examples/support/provenance/support.refund.summary.provenance.json +2 -6
- package/examples/support/replay/support.refund.approval_required.trace.json +4 -14
- package/package.json +22 -5
- package/schemas/audit/action-record.schema.json +4 -1
- package/schemas/aws/approval-task.schema.json +8 -1
- package/schemas/conformance/conformance-case.schema.json +18 -2
- package/schemas/conformance/conformance-report.schema.json +17 -2
- package/schemas/conformance/provider-target-matrix.schema.json +35 -4
- package/schemas/controls/control-decision.schema.json +7 -1
- package/schemas/eval-case.schema.json +8 -1
- package/schemas/eval-result.schema.json +8 -1
- package/schemas/evidence/evidence-pack.schema.json +34 -5
- package/schemas/governance/compatibility-diff.schema.json +8 -1
- package/schemas/governance/lifecycle-transition.schema.json +10 -1
- package/schemas/governance/risk-compilation-result.schema.json +9 -1
- package/schemas/provenance/generated-content-provenance.schema.json +3 -1
- package/schemas/replay/replay-result.schema.json +16 -2
- package/schemas/replay/replay-trace.schema.json +11 -2
- package/schemas/security/context-segment.schema.json +21 -12
- package/schemas/security/redaction-policy.schema.json +4 -1
- package/schemas/security-packs/coverage-report.schema.json +17 -2
- package/schemas/security-packs/security-case-suite.schema.json +11 -1
- package/schemas/tool-result-envelope.schema.json +9 -1
- package/security-packs/approval_bypass.yaml +12 -2
- package/security-packs/capability_spoofing.yaml +17 -3
- package/security-packs/cost_amplification.yaml +21 -4
- package/security-packs/cross_tenant_access.yaml +16 -3
- package/security-packs/insecure_output_rendering.yaml +15 -4
- package/security-packs/mcp_tool_abuse.yaml +17 -3
- package/security-packs/memory_scope_violation.yaml +19 -4
- package/security-packs/prompt_injection_direct.yaml +19 -4
- package/security-packs/prompt_injection_indirect.yaml +18 -3
- package/security-packs/provider_payload_exposure.yaml +26 -4
- package/security-packs/retrieval_poisoning.yaml +5 -2
- package/security-packs/schema_confusion.yaml +17 -3
- package/security-packs/sensitive_data_disclosure.yaml +22 -5
- package/security-packs/tool_exfiltration.yaml +20 -4
- package/security-packs/tool_result_poisoning.yaml +19 -4
- package/security-packs/unsafe_commit_attempt.yaml +6 -3
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# MCP Server Runtime
|
|
2
2
|
|
|
3
|
-
AICF MCP server runtime is an optional interoperability subpath for host
|
|
4
|
-
|
|
5
|
-
Context Protocol server.
|
|
3
|
+
AICF MCP server runtime is an optional interoperability subpath for host applications
|
|
4
|
+
that want to expose routed AICF capabilities through a Model Context Protocol server.
|
|
6
5
|
|
|
7
6
|
Import it from:
|
|
8
7
|
|
|
@@ -20,55 +19,52 @@ Descriptor-only MCP provider helpers are available separately:
|
|
|
20
19
|
import { buildMcpProviderToolDescriptors } from "ai-capability-framework/providers/mcp";
|
|
21
20
|
```
|
|
22
21
|
|
|
23
|
-
The package root and `ai-capability-framework/runtime` do not import the MCP SDK.
|
|
24
|
-
|
|
22
|
+
The package root and `ai-capability-framework/runtime` do not import the MCP SDK. The
|
|
23
|
+
MCP SDK is optional unless a host uses SDK registration helpers.
|
|
25
24
|
|
|
26
25
|
## Runtime Boundary
|
|
27
26
|
|
|
28
|
-
`AicfMcpServer` is an in-process server core. It does not start an HTTP, SSE,
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
`AicfMcpServer` is an in-process server core. It does not start an HTTP, SSE, Streamable
|
|
28
|
+
HTTP, or stdio process by itself. Host applications own transport, authentication,
|
|
29
|
+
session handling, network policy, and deployment.
|
|
31
30
|
|
|
32
31
|
The server lists and executes only routed read and prepare capabilities. Commit
|
|
33
|
-
capabilities are not listed and are not executable through MCP tool calls.
|
|
34
|
-
|
|
32
|
+
capabilities are not listed and are not executable through MCP tool calls. Commit
|
|
33
|
+
remains host-controlled through the AICF action lifecycle manager.
|
|
35
34
|
|
|
36
35
|
## Tool Listing
|
|
37
36
|
|
|
38
|
-
Minimal usage is: validate manifests, build runtime context through a trusted
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
Minimal usage is: validate manifests, build runtime context through a trusted host
|
|
38
|
+
factory, route a read/prepare capability slice, instantiate `AicfMcpServer`, then bind
|
|
39
|
+
it to a host-owned MCP transport or SDK server.
|
|
41
40
|
|
|
42
41
|
`listTools(request)` resolves runtime context through a host-provided
|
|
43
|
-
`runtimeContextFactory`, builds model context through `AicfContextBuilder`,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
descriptor layer.
|
|
42
|
+
`runtimeContextFactory`, builds model context through `AicfContextBuilder`, routes
|
|
43
|
+
capabilities through `AicfCapabilityRouter`, and returns MCP tool descriptors generated
|
|
44
|
+
from the validated AICF manifests through the MCP provider descriptor layer.
|
|
47
45
|
|
|
48
|
-
The context factory must validate user, tenant, account, and permission context.
|
|
49
|
-
|
|
46
|
+
The context factory must validate user, tenant, account, and permission context. The MCP
|
|
47
|
+
client request is not a trusted identity source.
|
|
50
48
|
|
|
51
49
|
## Tool Calling
|
|
52
50
|
|
|
53
|
-
`callTool(request)` parses an MCP `tools/call`-style request, validates
|
|
54
|
-
|
|
55
|
-
`AicfToolExecutor`.
|
|
51
|
+
`callTool(request)` parses an MCP `tools/call`-style request, validates arguments
|
|
52
|
+
against the original AICF capability schema, and executes through `AicfToolExecutor`.
|
|
56
53
|
|
|
57
|
-
Tool output is a model-safe AICF runtime envelope serialized as text content.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
diagnostics.
|
|
54
|
+
Tool output is a model-safe AICF runtime envelope serialized as text content. Denied,
|
|
55
|
+
unavailable, validation-error, and failed paths return safe MCP error results without
|
|
56
|
+
stack traces, raw prompts, provider payloads, or private diagnostics.
|
|
61
57
|
|
|
62
|
-
Descriptor metadata includes MCP annotations and `_meta.aicf` summaries for
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
Descriptor metadata includes MCP annotations and `_meta.aicf` summaries for capability
|
|
59
|
+
ID, type, risk, lifecycle operation, approval requirement, security boundary, and side
|
|
60
|
+
effects. These are hints for MCP-compatible clients; AICF runtime validation and policy
|
|
61
|
+
remain authoritative.
|
|
66
62
|
|
|
67
63
|
## SDK Registration Helper
|
|
68
64
|
|
|
69
65
|
`registerAicfMcpTools()` can register the current routed tool set against a
|
|
70
|
-
caller-provided MCP SDK server object that exposes `registerTool()` or `tool()`.
|
|
71
|
-
|
|
66
|
+
caller-provided MCP SDK server object that exposes `registerTool()` or `tool()`. It does
|
|
67
|
+
not import MCP transports or create a long-running process.
|
|
72
68
|
|
|
73
69
|
```ts
|
|
74
70
|
await registerAicfMcpTools({
|
|
@@ -78,12 +74,12 @@ await registerAicfMcpTools({
|
|
|
78
74
|
});
|
|
79
75
|
```
|
|
80
76
|
|
|
81
|
-
For production MCP deployments, host applications should pin SDK versions,
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
For production MCP deployments, host applications should pin SDK versions, validate
|
|
78
|
+
transport auth, enforce tenant/account context on the server side, and apply the same
|
|
79
|
+
audit and approval controls used by other AICF runtime paths.
|
|
84
80
|
|
|
85
|
-
The public runtime support/billing example shows the executor and lifecycle
|
|
86
|
-
|
|
81
|
+
The public runtime support/billing example shows the executor and lifecycle objects that
|
|
82
|
+
an MCP host can reuse behind `AicfMcpServer.callTool()`.
|
|
87
83
|
|
|
88
84
|
## Checks
|
|
89
85
|
|
|
@@ -93,6 +89,6 @@ npm run test:mcp-provider
|
|
|
93
89
|
npm run test:mcp-server
|
|
94
90
|
```
|
|
95
91
|
|
|
96
|
-
Known limitations: no standalone HTTP, SSE, Streamable HTTP, or stdio server;
|
|
97
|
-
|
|
98
|
-
|
|
92
|
+
Known limitations: no standalone HTTP, SSE, Streamable HTTP, or stdio server; no full
|
|
93
|
+
MCP transport matrix; no production auth; no raw MCP payload logging; and no
|
|
94
|
+
model-exposed commit path.
|
package/docs/memory.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Governed Memory And Preferences
|
|
2
2
|
|
|
3
|
-
AICF memory governance is an optional contract for host-owned memory and
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
AICF memory governance is an optional contract for host-owned memory and preferences. It
|
|
4
|
+
helps a host decide whether a summarized memory record may be shown to a model as
|
|
5
|
+
context.
|
|
6
6
|
|
|
7
7
|
Import it from:
|
|
8
8
|
|
|
@@ -13,57 +13,56 @@ import {
|
|
|
13
13
|
} from "ai-capability-framework/memory";
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
The memory subpath does not store memory, recall memory, infer preferences,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
The memory subpath does not store memory, recall memory, infer preferences, embed text,
|
|
17
|
+
search vectors, call models, or update user profiles. Host applications own memory
|
|
18
|
+
storage, consent, deletion, identity resolution, tenant scoping, and user-facing
|
|
19
|
+
preference controls.
|
|
20
20
|
|
|
21
21
|
## Records
|
|
22
22
|
|
|
23
|
-
`GovernedMemoryRecord` stores a public-safe summary, not raw transcripts or raw
|
|
24
|
-
|
|
23
|
+
`GovernedMemoryRecord` stores a public-safe summary, not raw transcripts or raw profile
|
|
24
|
+
data. Each record includes:
|
|
25
25
|
|
|
26
26
|
- redacted subject/account/tenant refs where relevant;
|
|
27
27
|
- a scope such as `user`, `account`, `tenant`, `workflow`, or `session`;
|
|
28
28
|
- a purpose and `contentSummary`;
|
|
29
|
-
- source provenance, confidence, sensitivity labels, consent basis, allowed use
|
|
30
|
-
|
|
29
|
+
- source provenance, confidence, sensitivity labels, consent basis, allowed use cases,
|
|
30
|
+
disallowed use cases, timestamps, and optional retention policy.
|
|
31
31
|
|
|
32
|
-
Preferences use the same record shape. For example, a support user preference
|
|
33
|
-
|
|
32
|
+
Preferences use the same record shape. For example, a support user preference can allow
|
|
33
|
+
`support_refund_preparation` while disallowing cross-tenant support.
|
|
34
34
|
|
|
35
35
|
## Exposure
|
|
36
36
|
|
|
37
|
-
`evaluateMemoryExposure(record, context)` fails closed when a record is expired,
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
`evaluateMemoryExposure(record, context)` fails closed when a record is expired, out of
|
|
38
|
+
scope, missing a matching use case, explicitly disallowed, credential classified, or
|
|
39
|
+
sensitive without consent.
|
|
40
40
|
|
|
41
|
-
`selectGovernedMemory(records, context)` evaluates every record, keeps only
|
|
42
|
-
|
|
41
|
+
`selectGovernedMemory(records, context)` evaluates every record, keeps only allowed
|
|
42
|
+
records, sorts them by record ID, and applies a default maximum of 20.
|
|
43
43
|
|
|
44
|
-
Allowed use cases are exact string matches in F12. There is no wildcard or
|
|
45
|
-
|
|
44
|
+
Allowed use cases are exact string matches in F12. There is no wildcard or semantic
|
|
45
|
+
matching.
|
|
46
46
|
|
|
47
47
|
## Context Conversion
|
|
48
48
|
|
|
49
49
|
`memoryRecordToContextSegment()` converts a selected record into a security
|
|
50
|
-
`ContextSegment` with `instructionsAllowed: false`. Memory is data, not a
|
|
51
|
-
|
|
50
|
+
`ContextSegment` with `instructionsAllowed: false`. Memory is data, not a system or
|
|
51
|
+
developer instruction.
|
|
52
52
|
|
|
53
|
-
`memoryRecordToRuntimeContextItem()` converts a selected record into a runtime
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
`memoryRecordToRuntimeContextItem()` converts a selected record into a runtime context
|
|
54
|
+
item for host-controlled context building. It includes purpose, confidence, scope,
|
|
55
|
+
sensitivity labels, and the summary without exposing raw subject IDs or private
|
|
56
|
+
diagnostics.
|
|
57
57
|
|
|
58
|
-
Sensitive or credential-classified records still go through the existing
|
|
59
|
-
|
|
58
|
+
Sensitive or credential-classified records still go through the existing security
|
|
59
|
+
redaction helpers before crossing provider or trace boundaries.
|
|
60
60
|
|
|
61
61
|
## Example
|
|
62
62
|
|
|
63
|
-
The public fixture at
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
list. It is validated by `npm run validate`.
|
|
63
|
+
The public fixture at `examples/support/memory/support.agent.preferences.json` is
|
|
64
|
+
synthetic. It shows a support preference summary with redacted refs and an explicit
|
|
65
|
+
use-case allow list. It is validated by `npm run validate`.
|
|
67
66
|
|
|
68
67
|
```bash
|
|
69
68
|
npm run validate
|
|
@@ -72,8 +71,8 @@ npm run test:memory
|
|
|
72
71
|
|
|
73
72
|
## Boundaries
|
|
74
73
|
|
|
75
|
-
AICF does not decide what should be remembered. It only helps a host govern
|
|
76
|
-
|
|
74
|
+
AICF does not decide what should be remembered. It only helps a host govern whether a
|
|
75
|
+
host-supplied memory summary may be used for a specific request.
|
|
77
76
|
|
|
78
|
-
Do not put raw prompts, raw provider payloads, raw transcripts, credentials,
|
|
79
|
-
|
|
77
|
+
Do not put raw prompts, raw provider payloads, raw transcripts, credentials, tenant IDs,
|
|
78
|
+
account IDs, user IDs, or customer data in public memory fixtures.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Migration From 0.1 To 1.0
|
|
2
2
|
|
|
3
|
-
AICF 1.0 is a clean public contract cut from the pre-release 0.1 work. The
|
|
4
|
-
|
|
3
|
+
AICF 1.0 is a clean public contract cut from the pre-release 0.1 work. The validator
|
|
4
|
+
intentionally does not support both schema versions side by side.
|
|
5
5
|
|
|
6
6
|
## Required Changes
|
|
7
7
|
|
|
@@ -9,14 +9,19 @@ validator intentionally does not support both schema versions side by side.
|
|
|
9
9
|
`schema_version: "1.0"`.
|
|
10
10
|
- Regenerate TypeScript manifest types with `npm run generate:types`.
|
|
11
11
|
- Re-run `npm run validate` and `npm run check`.
|
|
12
|
-
- Update docs, changelog entries, and release notes that refer to the manifest
|
|
13
|
-
|
|
12
|
+
- Update docs, changelog entries, and release notes that refer to the manifest contract
|
|
13
|
+
version.
|
|
14
|
+
- If test tooling imported `runCli` from `ai-capability-framework`, update that import
|
|
15
|
+
to `ai-capability-framework/cli`.
|
|
14
16
|
|
|
15
17
|
## Compatibility Notes
|
|
16
18
|
|
|
17
|
-
The 1.0 contract preserves the v0.1 public shape and no-execution boundary. The
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
The 1.0 contract preserves the v0.1 public shape and no-execution boundary. The main
|
|
20
|
+
compatibility change is the schema version literal. Treat v0.1 examples as pre-release
|
|
21
|
+
material and update them before using the 1.0 validator.
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
Release-candidate CLI runner imports moved out of the root package before v1. The `aicf`
|
|
24
|
+
binary did not change; only programmatic imports should switch to the `./cli` subpath.
|
|
25
|
+
|
|
26
|
+
Host applications remain responsible for model calls, auth, facts, approvals, side
|
|
27
|
+
effects, storage, and durable audit logs.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Observability Overview
|
|
2
2
|
|
|
3
|
-
AICF observability emits sanitized metadata events and spans. It does not store
|
|
4
|
-
|
|
5
|
-
default.
|
|
3
|
+
AICF observability emits sanitized metadata events and spans. It does not store raw
|
|
4
|
+
prompts, raw provider payloads, traces, secrets, or sensitive tool output by default.
|
|
6
5
|
|
|
7
6
|
Read:
|
|
8
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Observability Runtime
|
|
2
2
|
|
|
3
|
-
AICF observability is an optional set of trace sinks and redaction helpers for
|
|
4
|
-
|
|
3
|
+
AICF observability is an optional set of trace sinks and redaction helpers for runtime
|
|
4
|
+
behavior. Import it from:
|
|
5
5
|
|
|
6
6
|
```ts
|
|
7
7
|
import {
|
|
@@ -12,23 +12,21 @@ import {
|
|
|
12
12
|
} from "ai-capability-framework/observability";
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
The package root and runtime subpath do not require OpenTelemetry, Langfuse, or
|
|
16
|
-
|
|
15
|
+
The package root and runtime subpath do not require OpenTelemetry, Langfuse, or any
|
|
16
|
+
provider SDK.
|
|
17
17
|
|
|
18
18
|
Sanitized runtime traces can be replayed or converted into draft evals through
|
|
19
|
-
`ai-capability-framework/replay`. Replay fixtures should contain metadata,
|
|
20
|
-
|
|
21
|
-
provider payloads.
|
|
19
|
+
`ai-capability-framework/replay`. Replay fixtures should contain metadata, hashes,
|
|
20
|
+
model-safe envelopes, and redaction summaries, not raw prompts or raw provider payloads.
|
|
22
21
|
|
|
23
22
|
## Trace Events
|
|
24
23
|
|
|
25
|
-
Trace events are structured summaries with run ID, request ID, timestamp, event
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
Trace events are structured summaries with run ID, request ID, timestamp, event type,
|
|
25
|
+
and JSON-safe attributes. They are intended for runtime inspection and external
|
|
26
|
+
observability sinks, not raw transcript storage.
|
|
28
27
|
|
|
29
|
-
Default event capture is metadata-only. Raw prompts, user text, tool outputs,
|
|
30
|
-
|
|
31
|
-
emitted by default.
|
|
28
|
+
Default event capture is metadata-only. Raw prompts, user text, tool outputs, provider
|
|
29
|
+
payloads, secrets, session tokens, cookies, and payment data are not emitted by default.
|
|
32
30
|
|
|
33
31
|
Content capture modes:
|
|
34
32
|
|
|
@@ -36,48 +34,46 @@ Content capture modes:
|
|
|
36
34
|
- `metadata`: keep size/key summaries only.
|
|
37
35
|
- `redacted_content`: include redacted content after sensitive-value scrubbing.
|
|
38
36
|
|
|
39
|
-
When trace attributes include AICF security classification metadata, the
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
When trace attributes include AICF security classification metadata, the optional
|
|
38
|
+
`ai-capability-framework/security` redaction defaults are applied before collection.
|
|
39
|
+
This preserves existing capture modes while adding fail-closed handling for credentials
|
|
40
|
+
and sensitive data classes.
|
|
43
41
|
|
|
44
42
|
## Trace Sinks
|
|
45
43
|
|
|
46
44
|
- `NoopTraceSink` discards events.
|
|
47
45
|
- `CollectingTraceSink` stores sanitized events in memory for tests.
|
|
48
46
|
- `CompositeTraceSink` fans out to multiple sinks and isolates sink failures.
|
|
49
|
-
- `NoopTracer`, `InMemoryTracer`, `TraceSinkTracer`, and
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
`gen_ai.*` attributes plus stable `aicf.*` attributes.
|
|
47
|
+
- `NoopTracer`, `InMemoryTracer`, `TraceSinkTracer`, and `OpenTelemetryTracerAdapter`
|
|
48
|
+
provide a run/span-style API over the same sanitized event model.
|
|
49
|
+
- `OpenTelemetryTraceSink` accepts a tracer-like API object and maps useful `gen_ai.*`
|
|
50
|
+
attributes plus stable `aicf.*` attributes.
|
|
54
51
|
|
|
55
|
-
OpenTelemetry GenAI conventions are still evolving, so AICF keeps its own
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
OpenTelemetry GenAI conventions are still evolving, so AICF keeps its own namespaced
|
|
53
|
+
attributes for framework-specific data such as capability ID, policy status, action
|
|
54
|
+
state, run ID, and request ID.
|
|
58
55
|
|
|
59
56
|
## OpenAI Runtime Integration
|
|
60
57
|
|
|
61
|
-
`runOpenAIResponses()` accepts optional `traceSink` and `contentCapture`
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
`runOpenAIResponses()` accepts optional `traceSink` and `contentCapture` options. It
|
|
59
|
+
emits events for context building, routing, model calls, tool call parsing, tool
|
|
60
|
+
execution, runtime errors, and completion.
|
|
64
61
|
|
|
65
62
|
Trace sink failures do not fail the runtime request. They produce safe internal
|
|
66
63
|
diagnostics only.
|
|
67
64
|
|
|
68
65
|
## Langfuse
|
|
69
66
|
|
|
70
|
-
Langfuse support is available from `ai-capability-framework/langfuse`. The
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
Langfuse support is available from `ai-capability-framework/langfuse`. The adapter
|
|
68
|
+
accepts a client-like object and probes methods at runtime, so the SDK is optional and
|
|
69
|
+
version drift does not affect Core imports.
|
|
73
70
|
|
|
74
|
-
Langfuse dataset helpers convert AICF eval cases into public-safe dataset items
|
|
75
|
-
|
|
71
|
+
Langfuse dataset helpers convert AICF eval cases into public-safe dataset items and
|
|
72
|
+
back. They do not upload data by themselves.
|
|
76
73
|
|
|
77
|
-
`LangfuseTracerAdapter` wraps the same sink behavior with the run/span-style
|
|
78
|
-
|
|
79
|
-
Langfuse SDK.
|
|
74
|
+
`LangfuseTracerAdapter` wraps the same sink behavior with the run/span-style tracer API.
|
|
75
|
+
It still accepts a client-like object and does not require the Langfuse SDK.
|
|
80
76
|
|
|
81
|
-
The runtime support/billing example is intentionally no-model and no-trace by
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
The runtime support/billing example is intentionally no-model and no-trace by default.
|
|
78
|
+
Hosts can add `CollectingTraceSink` or another sink around the same runtime path when
|
|
79
|
+
they need sanitized runtime inspection.
|
package/docs/openai-responses.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# OpenAI Responses Adapter
|
|
2
2
|
|
|
3
|
-
The OpenAI Responses adapter exports AICF capabilities as no-model-call function
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
The OpenAI Responses adapter exports AICF capabilities as no-model-call function tool
|
|
4
|
+
definitions. It converts validated manifests into tool definitions and maps model tool
|
|
5
|
+
calls back to capability IDs and validated arguments.
|
|
6
6
|
|
|
7
|
-
The adapter does not call OpenAI, execute handlers, persist action state, verify
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
The adapter does not call OpenAI, execute handlers, persist action state, verify real
|
|
8
|
+
authorization, collect approvals, commit side effects, or write audit logs. Host
|
|
9
|
+
applications own those runtime responsibilities.
|
|
10
10
|
|
|
11
11
|
For the optional live Responses tool loop, see
|
|
12
12
|
[OpenAI Responses runtime](openai-runtime.md). The adapter on this page exports
|
|
@@ -14,8 +14,8 @@ descriptor JSON only.
|
|
|
14
14
|
|
|
15
15
|
## Tool Export
|
|
16
16
|
|
|
17
|
-
Use `buildOpenAIResponsesTools(registry, options)` with a validated registry and
|
|
18
|
-
|
|
17
|
+
Use `buildOpenAIResponsesTools(registry, options)` with a validated registry and a
|
|
18
|
+
request context:
|
|
19
19
|
|
|
20
20
|
```ts
|
|
21
21
|
const toolset = buildOpenAIResponsesTools(registry, {
|
|
@@ -33,16 +33,16 @@ The result contains:
|
|
|
33
33
|
- `excluded`: capabilities not exported and the reason.
|
|
34
34
|
- `diagnostics`: export warnings or fatal name-collision errors.
|
|
35
35
|
|
|
36
|
-
By default the adapter exports only capabilities whose `select` decision is
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
By default the adapter exports only capabilities whose `select` decision is allowed. For
|
|
37
|
+
export, the context autonomy tier is treated as the toolset ceiling and capped at each
|
|
38
|
+
capability's own autonomy tier before the select decision is evaluated. This lets an
|
|
39
|
+
`A2` toolset include an `A1` read capability while still preserving capability-level
|
|
40
|
+
autonomy limits.
|
|
41
41
|
|
|
42
|
-
The adapter also excludes restricted side-effect capabilities, including commit,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
The adapter also excludes restricted side-effect capabilities, including commit, send,
|
|
43
|
+
irreversible, money-moving, permission-changing, and workflow-triggering capabilities.
|
|
44
|
+
Use `includeRestricted: true` only when the host application has already narrowed
|
|
45
|
+
context and is deliberately constructing a restricted toolset.
|
|
46
46
|
|
|
47
47
|
## OpenAI Shape
|
|
48
48
|
|
|
@@ -63,29 +63,28 @@ Exported tools use the Responses function tool shape:
|
|
|
63
63
|
}
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
Tool names use `aicf_` plus a sanitized capability ID. Long names are capped at
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
Tool names use `aicf_` plus a sanitized capability ID. Long names are capped at 64
|
|
67
|
+
characters with a deterministic hash suffix. Tool descriptions include the manifest
|
|
68
|
+
model description, capability type, risk tier, autonomy tier, lifecycle flags, and use
|
|
69
|
+
guidance.
|
|
70
70
|
|
|
71
|
-
The adapter normalizes input schemas for OpenAI strict mode by making object
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
The adapter normalizes input schemas for OpenAI strict mode by making object properties
|
|
72
|
+
required, representing optional fields as nullable where possible, and setting
|
|
73
|
+
`additionalProperties: false`. Schemas that cannot be represented safely are excluded
|
|
74
|
+
with diagnostics.
|
|
75
75
|
|
|
76
76
|
## Tool Call Parsing
|
|
77
77
|
|
|
78
|
-
Use `parseOpenAIResponsesToolCall(toolset, call)` after a model returns a
|
|
79
|
-
|
|
78
|
+
Use `parseOpenAIResponsesToolCall(toolset, call)` after a model returns a Responses
|
|
79
|
+
`function_call` item. The parser:
|
|
80
80
|
|
|
81
81
|
- resolves the OpenAI tool name to an AICF capability ID;
|
|
82
82
|
- parses the JSON argument string;
|
|
83
83
|
- validates arguments against the capability input schema;
|
|
84
|
-
- returns structured diagnostics for unknown tools, invalid JSON, and schema
|
|
85
|
-
failures.
|
|
84
|
+
- returns structured diagnostics for unknown tools, invalid JSON, and schema failures.
|
|
86
85
|
|
|
87
|
-
The parser does not execute the capability. The host application should run a
|
|
88
|
-
|
|
86
|
+
The parser does not execute the capability. The host application should run a fresh
|
|
87
|
+
deterministic decision before prepare or commit execution.
|
|
89
88
|
|
|
90
89
|
## CLI
|
|
91
90
|
|
|
@@ -96,12 +95,12 @@ npm run build
|
|
|
96
95
|
node dist/cli.js openai-tools examples --context examples/support/openai/context.support_agent.json
|
|
97
96
|
```
|
|
98
97
|
|
|
99
|
-
The command prints JSON containing `tools`, `bindings`, `excluded`, and
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
The command prints JSON containing `tools`, `bindings`, `excluded`, and `diagnostics`.
|
|
99
|
+
It exits nonzero for invalid manifests, missing or invalid context JSON, tool-name
|
|
100
|
+
collisions, or when no tools are exportable.
|
|
102
101
|
|
|
103
102
|
## Reference Basis
|
|
104
103
|
|
|
105
|
-
OpenAI Responses accepts function tools in the request `tools` array. Function
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
OpenAI Responses accepts function tools in the request `tools` array. Function tools use
|
|
105
|
+
JSON Schema parameters, and strict schema adherence is recommended for reliable function
|
|
106
|
+
calling.
|