openapi: 3.2.0 info: title: HiveMorph v0.1 Xcalibur Membrane API description: 'Polymorphic agent runtime — single shape (Merchant), single supermodel (W2 MERCHANT). Three gates: NEED + YIELD + CLEAN-MONEY.' version: 0.1.0 tags: - name: xcalibur-membrane paths: /v1/xcalibur/membrane/health: get: tags: - xcalibur-membrane summary: Health description: Liveness probe for the MEMBRANE primitive. operationId: health_v1_xcalibur_membrane_health_get responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Health V1 Xcalibur Membrane Health Get /v1/xcalibur/membrane/score: post: tags: - xcalibur-membrane summary: Score description: 'Score an LLM output against sensitivity-labelled prompt spans. Returns the decision (BLOCK / WARN / PASS), IFS, and a signed receipt.' operationId: score_v1_xcalibur_membrane_score_post requestBody: content: application/json: schema: $ref: '#/components/schemas/ScoreRequest' required: true responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Score V1 Xcalibur Membrane Score Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/xcalibur/membrane/verify: post: tags: - xcalibur-membrane summary: Verify description: 'Verify a MEMBRANE receipt. Checks: - signature_ok: Ed25519 signature is valid against receipt body - math_ok: recorded decision is consistent with IFS and thresholds' operationId: verify_v1_xcalibur_membrane_verify_post requestBody: content: application/json: schema: $ref: '#/components/schemas/hivemorph__xcalibur__membrane_routes__VerifyRequest' required: true responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Verify V1 Xcalibur Membrane Verify Post '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/xcalibur/membrane/enforce: post: tags: - xcalibur-membrane summary: Enforce description: 'Gate endpoint: runs scoring and either blocks or passes the output. - BLOCK → HTTP 403 with receipt - WARN / PASS → HTTP 200 with {"output": ..., "receipt": ...}' operationId: enforce_v1_xcalibur_membrane_enforce_post requestBody: content: application/json: schema: $ref: '#/components/schemas/EnforceRequest' required: true responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/xcalibur/membrane/canary-eval: get: tags: - xcalibur-membrane summary: Canary Eval description: 'Run the built-in adversarial canary test corpus. Returns sensitivity (leak detection rate), specificity (clean pass rate), and per-case results. This is the seed of the MEMBRANE-EVAL-500 benchmark.' operationId: canary_eval_v1_xcalibur_membrane_canary_eval_get responses: '200': description: Successful Response content: application/json: schema: additionalProperties: true type: object title: Response Canary Eval V1 Xcalibur Membrane Canary Eval Get components: schemas: ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError EnforceRequest: properties: spans: items: $ref: '#/components/schemas/SpanModel' type: array minItems: 1 title: Spans output: type: string maxLength: 128000 minLength: 1 title: Output embedding_model_id: type: string title: Embedding Model Id default: tfidf-deterministic-v1 policy: $ref: '#/components/schemas/PolicyModel' type: object required: - spans - output title: EnforceRequest ScoreRequest: properties: spans: items: $ref: '#/components/schemas/SpanModel' type: array minItems: 1 title: Spans output: type: string maxLength: 128000 minLength: 1 title: Output embedding_model_id: type: string title: Embedding Model Id default: tfidf-deterministic-v1 policy: $ref: '#/components/schemas/PolicyModel' type: object required: - spans - output title: ScoreRequest PolicyModel: properties: tau_block: type: number maximum: 1.0 minimum: 0.0 title: Tau Block default: 0.18 tau_warn: type: number maximum: 1.0 minimum: 0.0 title: Tau Warn default: 0.06 type: object title: PolicyModel hivemorph__xcalibur__membrane_routes__VerifyRequest: properties: receipt: additionalProperties: true type: object title: Receipt type: object required: - receipt title: VerifyRequest HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError SpanModel: properties: text: type: string maxLength: 32000 minLength: 1 title: Text label: type: string maxLength: 64 title: Label default: PUBLIC type: object required: - text title: SpanModel