Bernstein Audit API

The audit API from Bernstein — 6 operation(s) for audit.

Operations 8

GET /audit Query Audit Log #
GET /audit/verify Audit Verify #
POST /audit/verify Audit Reverify #
POST /audit/export Audit Export #
GET /api/v1/audit Query Audit Log #
GET /api/v1/audit/verify Audit Verify #
POST /api/v1/audit/verify Audit Reverify #
POST /api/v1/audit/export Audit Export #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/bernstein-run:bernstein-run-audit-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

bernstein-run-audit-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Bernstein Task Server Audit API
  description: 'Bernstein REST API - the open-source governance layer for AI agents, one git worktree per task.


    ## Authentication


    Authentication is ENABLED by default. Include a Bearer token in all requests:


    ```

    Authorization: Bearer

    ```


    To run without auth (development only), set `BERNSTEIN_AUTH_DISABLED=1` - this logs a loud warning and passes every request through.


    Public endpoints (no auth required): `/health`, `/health/ready`, `/health/live`, `/ready`, `/alive`, `/.well-known/agent.json`, `/docs`, `/openapi.json`, and the auth-flow endpoints (`/auth/login`, `/auth/oidc/callback`, etc.).


    Webhook and hook endpoints (`/webhook`, `/webhooks/*`, `/hooks/{session_id}`) authenticate via HMAC-SHA256 signatures - they do NOT accept Bearer tokens.


    ## Base URL


    Default: `http://127.0.0.1:8052`. Override with env vars `BERNSTEIN_HOST` and `BERNSTEIN_PORT`.


    ## Error Format


    All errors return JSON with a `detail` field:


    ```json

    {"detail": "Task not found: task-xyz"}

    ```


    | Status | Meaning |

    |--------|---------|

    | 400 | Bad request (validation error) |

    | 401 | Unauthorized (missing/invalid token) |

    | 403 | Forbidden (IP not in allowlist) |

    | 404 | Resource not found |

    | 409 | Conflict (task already in terminal state) |

    | 429 | Rate limited - respect the `Retry-After` header |

    | 500 | Internal server error |'
  version: 3.22.0
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  contact:
    name: Alex Chernysh
    url: https://github.com/sipyourdrink-ltd/bernstein
servers:
- url: http://{host}:{port}
  description: Task server started by the Bernstein CLI on the operator's own machine. There is no hosted instance; substitute the host and port of your install.
  variables:
    host:
      default: 127.0.0.1
      description: Interface the task server binds to. Loopback by default.
    port:
      default: '8052'
      description: Task server port. Override with BERNSTEIN_PORT.
tags:
- name: Audit
paths:
  /audit:
    get:
      tags:
      - Audit
      summary: Query Audit Log
      description: 'Query the audit log with filtering and pagination.


        Returns:

        Dict with items, total, page, page_size. Items are normalised

        through :func:`_normalise_audit_row` so the web GUI table can

        render every row without optional-chain dance.'
      operationId: query_audit_log_audit_get
      parameters:
      - name: event_type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Event Type
      - name: search
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Search
      - name: page
        in: query
        required: false
        schema:
          type: integer
          default: 1
          title: Page
      - name: page_size
        in: query
        required: false
        schema:
          type: integer
          default: 50
          title: Page Size
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Query Audit Log Audit Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /audit/verify:
    get:
      tags:
      - Audit
      summary: Audit Verify
      description: 'Lightweight HMAC chain integrity probe for the web GUI banner.


        Walks ``.sdd/audit/*.jsonl`` events and returns a fully-populated

        payload (no nulls in core scalar fields) so the GUI''s

        ``ChainStatusBanner`` has something to render even when the audit

        directory hasn''t been initialised yet. Full Sigstore / Merkle

        reconciliation lives in the lineage-v1 verifier CLI.'
      operationId: audit_verify_audit_verify_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Audit Verify Audit Verify Get
    post:
      tags:
      - Audit
      summary: Audit Reverify
      description: 'Re-walk the audit chain.


        Behaviourally identical to ``GET /audit/verify`` for the lightweight

        probe - the operator-visible "Re-verify" button in the GUI just wants

        a fresh walk and an up-to-date payload. Accepts ``{from_chunk}`` so

        future implementations can scope the walk; today the field is read

        and echoed but not used to slice the chain.'
      operationId: audit_reverify_audit_verify_post
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - $ref: '#/components/schemas/VerifyChainRequest'
              - type: 'null'
              title: Body
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Audit Reverify Audit Verify Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /audit/export:
    post:
      tags:
      - Audit
      summary: Audit Export
      description: 'Stream the filtered audit log as CSV or JSONL.


        Same filter semantics as ``GET /audit`` (``event_type``, ``search``,

        ``from``, ``to``); returns the entire matching set in one body, no

        pagination - operators expect to download the whole filtered slice.

        Used by the web GUI Export menu (CSV / JSONL buttons).'
      operationId: audit_export_audit_export_post
      parameters:
      - name: format
        in: query
        required: false
        schema:
          type: string
          default: csv
          title: Format
      - name: event_type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Event Type
      - name: search
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Search
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/audit:
    get:
      tags:
      - Audit
      summary: Query Audit Log
      description: 'Query the audit log with filtering and pagination.


        Returns:

        Dict with items, total, page, page_size. Items are normalised

        through :func:`_normalise_audit_row` so the web GUI table can

        render every row without optional-chain dance.'
      operationId: query_audit_log_api_v1_audit_get
      parameters:
      - name: event_type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Event Type
      - name: search
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Search
      - name: page
        in: query
        required: false
        schema:
          type: integer
          default: 1
          title: Page
      - name: page_size
        in: query
        required: false
        schema:
          type: integer
          default: 50
          title: Page Size
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Query Audit Log Api V1 Audit Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/audit/verify:
    get:
      tags:
      - Audit
      summary: Audit Verify
      description: 'Lightweight HMAC chain integrity probe for the web GUI banner.


        Walks ``.sdd/audit/*.jsonl`` events and returns a fully-populated

        payload (no nulls in core scalar fields) so the GUI''s

        ``ChainStatusBanner`` has something to render even when the audit

        directory hasn''t been initialised yet. Full Sigstore / Merkle

        reconciliation lives in the lineage-v1 verifier CLI.'
      operationId: audit_verify_api_v1_audit_verify_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Audit Verify Api V1 Audit Verify Get
    post:
      tags:
      - Audit
      summary: Audit Reverify
      description: 'Re-walk the audit chain.


        Behaviourally identical to ``GET /audit/verify`` for the lightweight

        probe - the operator-visible "Re-verify" button in the GUI just wants

        a fresh walk and an up-to-date payload. Accepts ``{from_chunk}`` so

        future implementations can scope the walk; today the field is read

        and echoed but not used to slice the chain.'
      operationId: audit_reverify_api_v1_audit_verify_post
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - $ref: '#/components/schemas/VerifyChainRequest'
              - type: 'null'
              title: Body
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Audit Reverify Api V1 Audit Verify Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/audit/export:
    post:
      tags:
      - Audit
      summary: Audit Export
      description: 'Stream the filtered audit log as CSV or JSONL.


        Same filter semantics as ``GET /audit`` (``event_type``, ``search``,

        ``from``, ``to``); returns the entire matching set in one body, no

        pagination - operators expect to download the whole filtered slice.

        Used by the web GUI Export menu (CSV / JSONL buttons).'
      operationId: audit_export_api_v1_audit_export_post
      parameters:
      - name: format
        in: query
        required: false
        schema:
          type: string
          default: csv
          title: Format
      - name: event_type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Event Type
      - name: search
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Search
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
    VerifyChainRequest:
      properties:
        from_chunk:
          anyOf:
          - type: integer
          - type: 'null'
          title: From Chunk
      type: object
      title: VerifyChainRequest
      description: Body for ``POST /audit/verify`` (re-verify chain or chunk).