adk_connector_manifest (erlang_adk v0.10.0)

View Source

Strict, internal policy manifest for first-party connector tools.

A connector manifest is never copied into a provider-facing tool schema. Every advertised tool must declare its least-authority permissions, side effect class, confirmation policy, and concurrency safety. Unknown or missing metadata is rejected rather than receiving a permissive default.

Summary

Functions

Enforce the manifest on an adapter-created resolved call. Metadata supplied by an adapter can make a call stricter, but cannot weaken the manifest. Conditional confirmation must be decided explicitly per call.

Types

confirmation/0

-type confirmation() :: never | required | conditional.

manifest/0

-type manifest() ::
          #{schema_version := 1,
            connector_id := binary(),
            service := native | mcp | openapi,
            tools := [tool_policy()],
            tool_index := #{binary() => tool_policy()}}.

side_effect/0

-type side_effect() :: none | read | write | external_action | destructive.

tool_policy/0

-type tool_policy() ::
          #{name := binary(),
            permissions := [binary()],
            side_effect := side_effect(),
            confirmation := confirmation(),
            parallel_safe := boolean()}.

Functions

apply_execution_policy(Call, Policy)

-spec apply_execution_policy(map(), tool_policy()) -> {ok, map()} | {error, term()}.

Enforce the manifest on an adapter-created resolved call. Metadata supplied by an adapter can make a call stricter, but cannot weaken the manifest. Conditional confirmation must be decided explicitly per call.

describe(Manifest)

-spec describe(manifest()) -> map().

tool(Manifest, Name)

-spec tool(manifest(), binary()) -> {ok, tool_policy()} | {error, unknown_connector_tool}.

validate(Manifest)

-spec validate(term()) -> {ok, manifest()} | {error, term()}.

validate_schemas(Manifest, Schemas)

-spec validate_schemas(manifest(), term()) -> ok | {error, term()}.