AHG Extensions for AtoM

Home / Plugins / AI Compliance

AI Compliance

EU AI Act Article 12 record-keeping: a tamper-evident receipt chain over every AI inference call (SHA-256 chain, RFC 8785 JCS canonical JSON, Ed25519 signatures).

CategoryCompliance
PackageahgAiCompliancePlugin
Version0.1.0
StatusInstalls from source. Clean-database install not yet verified.
RequiresCore
LicenceAGPL-3.0-or-later
InstallFrom the source repository: see Installation below. No packaged download yet.

EU AI Act Article 12 record-keeping for the AtoM-AHG fork (PSIS twin of the Heratio ahg-ai-compliance package). Every AI inference call (LLM, HTR, NER, OCR, Translate, Guardrail, ...) writes one immutable row to ai_inference_log. Each row links to the previous via a SHA-256 chain; each row's hash is over the RFC 8785 JCS canonical form of the row's signing view; each hash is Ed25519-signed under a publisher key. The protocol primitives live in the framework-agnostic ahg/inference-receipts Composer library. This plugin is the AtoM integration layer.

Installation

  1. Add the Composer dependency to the AtoM root composer.json:

    "require": {
        "ahg/inference-receipts": "^0.1"
    }

    Then composer install --no-scripts from /usr/share/nginx/archive.

  2. Drop the plugin directory into plugins/ (or wherever your AtoM instance loads AHG plugins from; on this host the canonical path is /usr/share/nginx/archive/atom-ahg-plugins/ahgAiCompliancePlugin/).

  3. Run the install SQL against the AtoM database:

    mysqldump archive > /var/backups/archive-before-ai-compliance.sql
    php atom-framework/bin/install-plugin-schema.php --database=<database> --user=<user> --password=<password> --plugin=ahgAiCompliancePlugin   # from the AtoM root; never a plain mysql < install.sql

    Two new tables are created: ai_inference_log (the chain) and ai_inference_key (the per-kid public-key registry). Both are InnoDB / utf8mb4_unicode_ci and live alongside the existing ahg_* sidecar tables - no AtoM/Qubit base tables are touched.

  4. Generate the signing key:

    sudo -u www-data php symfony ai-compliance:install-key

    Writes the secret key (raw libsodium 64-byte) to data/ai-keys/inference-signing.sk (mode 0600) and registers the kid in ai_inference_key. Run as the same uid that AtoM serves under so the web action can read it back if needed.

  5. Clear cache so Symfony picks up the new module + routes:

    php symfony cc
  6. Verify the endpoint:

    curl -i https://psis.theahg.co.za/.well-known/ai-inference-pubkey

    Should return 200 OK with application/json containing the issuer, purpose, spec URL, and a keys array with one active Ed25519 key.

Try it

This feature is for signed-in staff, so it is not open on the public demo.

Source and README on GitHub · Questions: support@theahg.co.za or WhatsApp