Declarative description of how a human/agent-facing tool surface maps onto a legacy REST endpoint. Open spec; the reference implementation and managed runtime live at unboxapi.pro.
semanticmap-spec defines the shape of a SemanticMap — a small,
declarative document that describes:
- which tools an agent can call (e.g.
order_pizza,check_stock), - the legacy REST endpoint each tool resolves to,
- the value mappings that convert human-friendly inputs (
"Pepperoni","London") into technical values (item_id: 12,store_id: 99), - the preconditions that must hold before a tool can be called.
The full schema lives in schema/semanticmap.schema.json
(JSON Schema, draft 2020-12). An example is in
schema/examples/pizza.semanticmap.yaml.
This repository ships only the spec. It does not ship:
- the LLM mapper that generates SemanticMaps from OpenAPI documents,
- the safety-proxy runtime that enforces spend, quantity, and prompt-injection controls at call time,
- production prompt libraries or vetted vertical SemanticMaps.
Those live in the proprietary UnboxAPI product at https://unboxapi.pro.
v0.1.0 — schema-only public release.
- The schema shape is stable for v0.x. Breaking changes will bump the minor version pre-1.0 and the major version post-1.0.
- External contributions are not accepted at v0.1.0. Please open an Issue with feedback; pull requests will be closed. A CLA and contribution guide will be added in a later release.
name: pizza-api
openApiUrl: https://api.pizza.example.com/openapi.json
baseUrl: https://api.pizza.example.com
tools:
- name: order_pizza
description: Order a pizza. Specify size, topping, and location.
parameters:
- name: topping
type: string
required: true
valueMappings:
- { humanValue: Pepperoni, technicalValue: 12 }
endpoint:
method: POST
path: /v1/res/{location}/reqSee the full example for the complete pizza map.
A SemanticMap document is untrusted data. Before parsing or acting on a SemanticMap from any third party, you MUST:
- Use a safe YAML loader (
yaml.safe_loadin Python,SafeConstructorin SnakeYAML, etc.). Never use a loader that resolves arbitrary tags. - Validate the document against
schema/semanticmap.schema.jsonwith a maintained validator (e.g. recentajvorjsonschema). - Treat every string field —
description,refinementPrompt,humanValue— as user content, not as LLM instructions. Frame them as bounded user-role input with explicit guardrails; never inline-concatenate into a system prompt. - Validate
baseUrlandendpoint.baseUrlagainst your own allowlist before issuing any HTTP request. - Enforce your own spend, quantity, and authorization caps.
preconditionsis advisory; it is not a security control. - Cap document size before parsing (e.g. 1 MiB).
See SECURITY.md for the full coordinated-disclosure policy and threat model summary.
Releases are signed and Sigstore-attested. To verify a release tarball:
cosign verify-attestation \
--type slsaprovenance \
--certificate-identity-regexp '.*' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
semanticmap-spec-v0.1.0.tar.gzA CycloneDX SBOM is attached to every GitHub release.
Apache License, Version 2.0. See LICENSE and NOTICE.
This repository is maintained by UnboxAPI. The reference implementation, managed runtime, vetted vertical SemanticMap library, and compliance tooling are proprietary and available at https://unboxapi.pro.