> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kombify.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Report kombify Guard host security and backup observations

> The Guard's posture channel. A full report carries what the Guard observed through the privileged executor's read-only StackKits operations: the `stackkit.host-security-evidence/v1` document of `stackkit host security verify` and the receipt states of `stackkit backup status`. A check-in (`check_in: true`) carries nothing and only asks whether a fresh observation was requested. The identity is the authenticated worker's; the control plane recomputes the verdict from the controls, judges time by its own clock, and records a document it cannot read (unknown schema version, unknown control or state, bad freshness window) as `evidence_rejected`, which leaves no earlier pass standing. A StackKits release without the command is reported as `unsupported` and shows as `security.state: unknown` with `reason_code: stackkit_cli_unsupported`. The answer is the directive: `verify_requested` and the routine cadence, and while the owner's approval of automatic repair is active, `local_policy`: the signed grant of that policy version. Editions without posture answer `state: disabled`. The same channel carries the evidence of a repair the Guard ran on its own under a local policy while the control plane was unreachable (a body with `operation_id`, `GuardLocalOperationEvidence`). It is accepted only against the registered policy version it names (same tenant, worker and exact expiry, a credential generation no newer than the authenticating one, started inside that version's lifetime, for controls it covers, within the persisted cooldown, attempt budget and circuit breaker) and acknowledged only after it is recorded in the server's repair journal. An identical repeat is acknowledged again (`duplicate: true`); anything else is refused with a structured `reason` and leaves no record.



## OpenAPI

````yaml /homelab/reference/api/openapi.yaml post /api/v1/workers/{id}/posture
openapi: 3.1.0
info:
  title: kombify-Homelab API
  description: >
    REST API for kombify-Homelab -- the hybrid cloud control plane for homelabs.


    kombify-Homelab manages infrastructure through a spec-driven architecture:

    validate YAML specs via CUE, generate OpenTofu configurations, and manage

    nodes through a gRPC agent protocol.


    ## Authentication


    Authenticated endpoints accept an OIDC/JWKS bearer token or an API key

    where documented. Self-hosted Homelab defaults to Pocket ID as identity

    provider. SaaS routes enter through the edge with Auth0 as the platform

    identity provider. PocketBase session exchange remains legacy migration

    compatibility only.


    ## Response Format


    **Success:** `{ "data": <object>, "meta": { "total": int, "page": int,
    "per_page": int } }`


    **Error:** `{ "error": { "code": "<ERROR_CODE>", "message": "...",
    "details": <any> } }`


    ## Pagination


    List endpoints accept `page` (default: 1) and `per_page` (default: 20, max:
    100) query parameters.
  version: 1.0.0
  contact:
    name: kombify
    url: https://kombify.io
  license:
    name: Apache-2.0 AND GPL-3.0
    url: https://github.com/kombifyio/Homelab/blob/main/LICENSE
servers:
  - url: https://api.kombify.io/v1/homelab
    description: >-
      Production canonical (via Cloudflare edge gateway, strip-prefix). Clients
      MUST use this projection. The Gateway strips /v1/homelab and re-adds
      /api/v1 at the origin, so it resolves the /api/v1/* paths below cleanly.
  - url: http://localhost:5260
    description: Local development
  - url: https://homelab.kombify.io
    description: Production (direct, no Gateway prefix)
  - url: https://api.kombify.io/v1/orchestrator
    description: >-
      Legacy StackKit-Orchestrator projection of the same origin. RETAINED for
      backward compatibility with existing consumers only. Do NOT use for mobile
      or new clients: combined with the /api/v1/* paths it double-resolves
      (yielding /v1/orchestrator/api/v1/...). Prefer /v1/homelab.
security:
  - bearerAuth: []
tags:
  - name: Health
    description: Health checks and service info (no auth required)
  - name: Instance
    description: Local instance identity and enrollment metadata
  - name: Stacks
    description: Stack lifecycle management (create, provision, deploy, destroy)
  - name: Stacks - Specs
    description: Access persisted specification chain (intent, requirements, unified)
  - name: Stacks - Import/Export
    description: Import and export StackKits stack-spec.yaml configurations
  - name: Stacks - Drift
    description: Infrastructure drift detection and resolution
  - name: Unifier
    description: Spec validation, analysis, unification, and IaC generation pipeline
  - name: StackKits
    description: Infrastructure template catalog
  - name: Add-ons
    description: Add-on detection and registry
  - name: Workers
    description: Worker node registration and management
  - name: Servers
    description: Canonical server lifecycle, connection, and health state
  - name: Inventory
    description: >-
      Owner-scoped sanitized server and service read models for UI, API, and MCP
      clients
  - name: Agents
    description: Connected gRPC agent management and commands
  - name: Jobs
    description: Background job monitoring and SSE streaming
  - name: Discovery
    description: Network device discovery and SSH testing
  - name: Features
    description: Feature flags (read-only; managed centrally via the kombify Admin API)
  - name: Monthly Runtime
    description: Provider-free user API for subscription-backed stack runtime control
  - name: Runtime
    description: Recent runtime/deploy logs (job/deploy progress + container tail)
  - name: Wallet
    description: >-
      Redacted recovery-item wallet with biometric/platform-reauth-gated reveal.
      List responses strip secret/totp; reveal requires a fresh trusted-reauth
      HMAC proof (5-minute window) and is audited server-side.
  - name: Trust
    description: Pairing tokens for worker enrollment
  - name: Client Binding
    description: >-
      Short-lived HTTPS pairing for a second client and normal OIDC account
      handoff
  - name: Tunnel
    description: Cloudflare tunnel management for NAT traversal
  - name: Backups
    description: Database backup management (admin only)
  - name: Auth
    description: Authentication mode and SSO configuration
  - name: Metrics
    description: Prometheus-compatible instance metrics for admin/infra scrapers
  - name: Internal
    description: >-
      Internal SaaS-only APIs, including servicecall-protected executor
      contracts
paths:
  /api/v1/workers/{id}/posture:
    post:
      tags:
        - Workers
      summary: Report kombify Guard host security and backup observations
      description: >-
        The Guard's posture channel. A full report carries what the Guard
        observed through the privileged executor's read-only StackKits
        operations: the `stackkit.host-security-evidence/v1` document of
        `stackkit host security verify` and the receipt states of `stackkit
        backup status`. A check-in (`check_in: true`) carries nothing and only
        asks whether a fresh observation was requested. The identity is the
        authenticated worker's; the control plane recomputes the verdict from
        the controls, judges time by its own clock, and records a document it
        cannot read (unknown schema version, unknown control or state, bad
        freshness window) as `evidence_rejected`, which leaves no earlier pass
        standing. A StackKits release without the command is reported as
        `unsupported` and shows as `security.state: unknown` with `reason_code:
        stackkit_cli_unsupported`. The answer is the directive:
        `verify_requested` and the routine cadence, and while the owner's
        approval of automatic repair is active, `local_policy`: the signed grant
        of that policy version. Editions without posture answer `state:
        disabled`. The same channel carries the evidence of a repair the Guard
        ran on its own under a local policy while the control plane was
        unreachable (a body with `operation_id`, `GuardLocalOperationEvidence`).
        It is accepted only against the registered policy version it names (same
        tenant, worker and exact expiry, a credential generation no newer than
        the authenticating one, started inside that version's lifetime, for
        controls it covers, within the persisted cooldown, attempt budget and
        circuit breaker) and acknowledged only after it is recorded in the
        server's repair journal. An identical repeat is acknowledged again
        (`duplicate: true`); anything else is refused with a structured `reason`
        and leaves no record.
      operationId: reportWorkerPosture
      parameters:
        - $ref: '#/components/parameters/resourceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/GuardPostureReport'
                - $ref: '#/components/schemas/GuardLocalOperationEvidence'
      responses:
        '200':
          description: >-
            The directive for the next observation, or the acknowledgement of
            local-policy evidence
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    oneOf:
                      - type: object
                        properties:
                          posture:
                            $ref: '#/components/schemas/GuardPostureDirective'
                      - $ref: >-
                          #/components/schemas/GuardLocalOperationAcknowledgement
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          description: Access token or proof not accepted
        '403':
          description: >-
            Local-policy evidence of a stale credential generation, or started
            after the policy version ended (`reason`: stale_generation,
            authority_expired)
        '409':
          description: >-
            Local-policy evidence refused (`reason`: local_policy_unregistered,
            local_policy_scope, local_evidence_invalid, repair_cooldown,
            repair_attempts_exhausted, repair_circuit_open,
            result_revision_conflict, result_revision_out_of_order,
            command_not_pending)
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - runtimeAgentAuth: []
components:
  parameters:
    resourceId:
      name: id
      in: path
      required: true
      description: Resource ID
      schema:
        type: string
  schemas:
    GuardPostureReport:
      type: object
      additionalProperties: false
      required:
        - schema_version
        - source_epoch
        - source_sequence
        - observed_at
      properties:
        schema_version:
          type: string
          enum:
            - kombify.guard-posture/v1
        check_in:
          type: boolean
          description: A check-in carries no observation.
        source_epoch:
          type: string
          maxLength: 64
        source_sequence:
          type: integer
          format: int64
          minimum: 0
        observed_at:
          type: string
          format: date-time
        guard_version:
          type: string
          maxLength: 64
        guard_signed:
          type: boolean
        verify_request_id:
          type: string
          pattern: ^[A-Za-z0-9_-]{1,64}$
          description: >-
            The `verify_request_id` of the directive being answered. Set only on
            a report whose observation the Guard started after it received that
            directive; a routine observation carries none.
        security:
          type: object
          required:
            - status
          properties:
            status:
              type: string
              enum:
                - observed
                - unsupported
                - unavailable
                - failed
            reason_code:
              type: string
              pattern: ^[a-z0-9_]{1,64}$
            evidence:
              type: object
              description: >-
                The stackkit.host-security-evidence/v1 document
                (schemas/stackkit-host-security-evidence-v1.schema.json), at
                most 256 KiB.
        backup:
          type: object
          required:
            - status
          properties:
            status:
              type: string
              enum:
                - observed
                - unsupported
                - unavailable
                - failed
            reason_code:
              type: string
              pattern: ^[a-z0-9_]{1,64}$
            ready:
              type: boolean
            snapshot_state:
              type: string
              enum:
                - recorded
                - unverified
                - clock-skew
            last_snapshot_at:
              type: string
              format: date-time
            restore_state:
              type: string
              enum:
                - recorded
                - unverified
                - clock-skew
            last_restore_at:
              type: string
              format: date-time
    GuardLocalOperationEvidence:
      type: object
      description: >-
        Evidence of one repair a Guard ran on its own under a local policy
        version. The operation ID is Guard-generated and names the policy
        version (`local:<policy_id>:v<version>:<nonce>`). Each revision is
        immutable; `report.digest` covers every other field. A first revision is
        `terminal` or `outcome_unknown`; a later revision only resolves an
        `outcome_unknown` and names the digest it supersedes.
      required:
        - operation_id
        - tenant_id
        - worker_id
        - generation
        - policy_id
        - policy_version
        - policy_expires_at
        - action
        - controls
        - started_at
        - report
      properties:
        operation_id:
          type: string
          maxLength: 128
          pattern: ^[A-Za-z0-9._:-]+$
        tenant_id:
          type: string
        worker_id:
          type: string
        generation:
          type: integer
          format: int64
          minimum: 1
        policy_id:
          type: string
        policy_version:
          type: integer
          format: int64
          minimum: 1
        policy_expires_at:
          type: string
          format: date-time
        action:
          type: string
          enum:
            - stackkit.host-security-repair
        controls:
          type: array
          items:
            type: string
        started_at:
          type: string
          format: date-time
        report:
          type: object
          required:
            - revision
            - state
            - digest
          properties:
            revision:
              type: integer
              format: int64
              minimum: 1
            state:
              type: string
              enum:
                - terminal
                - outcome_unknown
                - resolved
            digest:
              type: string
            prior_digest:
              type: string
            reason:
              type: string
              maxLength: 512
            resolution:
              type: string
              enum:
                - observed_converged
                - not_applied
                - operator_escalation
            truncated:
              type: boolean
        outcome:
          type: string
          pattern: ^[a-z0-9_]{1,64}$
          description: The stackkit.host-security-repair/v1 outcome of a terminal report.
        steps:
          type: array
          items:
            type: object
            required:
              - control
              - status
            properties:
              control:
                type: string
              status:
                type: string
              reason_code:
                type: string
    GuardPostureDirective:
      type: object
      properties:
        state:
          type: string
          enum:
            - disabled
          description: Present only where posture is off.
        verify_requested:
          type: boolean
        verify_request_id:
          type: string
          description: >-
            Opaque token of the pending request. The Guard echoes it as
            `verify_request_id` in the report of the fresh observation it starts
            for the request; only that report answers it. A Guard that does not
            echo it keeps working, and its second report without the token
            answers the request.
        verify_interval_seconds:
          type: integer
          minimum: 0
        local_policy:
          $ref: '#/components/schemas/GuardLocalRepairGrant'
    GuardLocalOperationAcknowledgement:
      type: object
      required:
        - command_id
        - revision
        - digest
        - accepted
        - acknowledged
      properties:
        command_id:
          type: string
          description: The operation ID of the acknowledged evidence.
        revision:
          type: integer
          format: int64
        digest:
          type: string
        accepted:
          type: boolean
        acknowledged:
          type: boolean
        duplicate:
          type: boolean
          description: True when an identical revision had already been recorded.
    GuardLocalRepairGrant:
      type: object
      description: >-
        The control plane's Ed25519-signed grant of the owner's current repair
        approval for this Guard (contract `guard.local-repair/v1`, signed with
        the worker's binding key the Guard pinned at pairing). Absent while no
        approval is active: the Guard then only observes. The Guard holds it in
        memory only and drops it on an answer without one. It admits a repair on
        its own only while the control plane is unreachable, for at most 15
        minutes after `issued_at` (the command authority lifetime) and never
        past `policy_expires_at`, on a clock that agreed with `issued_at` at
        receipt and still continues from it; after a restart it only observes
        until a fresh online answer. The privileged executor verifies the
        signature, the operation ID and the lifetime again before it runs the
        typed StackKits host-security repair, at most once per operation.
      required:
        - contract_version
        - policy_id
        - policy_version
        - tenant_id
        - worker_id
        - generation
        - action
        - controls
        - release
        - policy_expires_at
        - issued_at
        - bounds
        - history
        - key_id
        - signature
      properties:
        contract_version:
          type: string
          enum:
            - guard.local-repair/v1
        policy_id:
          type: string
        policy_version:
          type: integer
          format: int64
          minimum: 1
        tenant_id:
          type: string
        worker_id:
          type: string
        server_id:
          type: string
        generation:
          type: integer
          format: int64
          minimum: 1
        action:
          type: string
          enum:
            - stackkit.host-security-repair
        controls:
          type: array
          items:
            type: string
            enum:
              - bruteforce.fail2ban
              - firewall.default_inbound
              - kernel.sysctl
              - updates.unattended_upgrades
        release:
          type: object
          required:
            - version
            - platform_os
            - platform_arch
            - archive_sha256
            - release_index_sha256
          properties:
            version:
              type: string
            platform_os:
              type: string
            platform_arch:
              type: string
            archive_sha256:
              type: string
            release_index_sha256:
              type: string
        policy_expires_at:
          type: string
          format: date-time
        issued_at:
          type: string
          format: date-time
        bounds:
          type: object
          required:
            - cooldown_seconds
            - max_attempts_per_day
            - breaker_failures
            - breaker_open_seconds
          properties:
            cooldown_seconds:
              type: integer
              format: int64
            max_attempts_per_day:
              type: integer
            breaker_failures:
              type: integer
            breaker_open_seconds:
              type: integer
              format: int64
        history:
          type: array
          maxItems: 64
          description: >-
            The server's most recent repairs, which the Guard counts toward the
            bounds together with its own unreported local repairs.
          items:
            type: object
            required:
              - controls
              - requested_at
            properties:
              operation_id:
                type: string
              controls:
                type: array
                items:
                  type: string
              requested_at:
                type: string
                format: date-time
              finished_at:
                type: string
                format: date-time
              failed:
                type: boolean
        key_id:
          type: string
        signature:
          type: string
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - INTERNAL_ERROR
                - NOT_FOUND
                - BAD_REQUEST
                - UNAUTHORIZED
                - FORBIDDEN
                - CONFLICT
                - VALIDATION_ERROR
                - RATE_LIMITED
                - SERVICE_UNAVAILABLE
                - METHOD_NOT_ALLOWED
            message:
              type: string
            details:
              description: Additional error context (validation errors, etc.)
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: Required control-plane persistence or dependency is unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        OIDC/JWKS bearer token. Self-hosted defaults to Pocket ID; SaaS uses
        Auth0 through the edge. PocketBase JWT is legacy migration compatibility
        only.
    runtimeAgentAuth:
      type: http
      scheme: bearer
      bearerFormat: Homelab-Runtime-Agent
      description: >-
        Runtime-agent credential bound to the exact tenant, placement, server,
        and worker identity. Signed, opaque, and explicit legacy compatibility
        tokens are validated fail-closed by the worker runtime.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.