Pular para o conteúdo

Level 3: The Auditor (Glass Box Trace)

Este conteúdo não está disponível em sua língua ainda.

Goal: Verify your policy visually and cryptographically using the Glass Box method.

Prerequisite: Level 2 (The Integrator)


1. The Problem: “It passed, but can we trust the process?”

Section titled “1. The Problem: “It passed, but can we trust the process?””

In Level 2, you logged the compliance score. But for High-Risk AI (like Credit Scoring), metrics aren’t enough. An Auditor asks: “Did you test on the real dataset, or did you filter out the rejected loans?” and “Can you prove this code was actually run?“

2. The Solution: The “Glass Box” Trace

Section titled “2. The Solution: The “Glass Box” Trace”

Professional auditing requires more than just results — it requires Provenance.

Venturalitica uses a monitor() context manager to record everything:

  • The Code: AST analysis of your script.
  • The Data: Row count and column schema.
  • The Hardware: Memory, CPU, and Carbon stats (Article 15).
  • The Seal: A cryptographic SHA-256 hash of the entire session.

We continue working on the same project. No new setup required.

Wrap your execution in vl.monitor(). This context manager captures the “Handshake” between your code and the policy by harvesting both physical and logical metadata.

FeatureBlack Box (Standard)Glass Box (Venturalitica)
Logic”Trust me, I ran the code.”AST Analysis: We record which function mapped code to policy.
Data”Here is the CSV.”Fingerprint: We record the SHA-256 of the dataset at runtime.
ScopeCodeCode + Environment + Hardware Stats
import venturalitica as vl
from venturalitica.quickstart import load_sample
# 1. Start the Multimodal Monitor (The Glass Box)
with vl.monitor("loan_audit_v1"):
# This block is now being watched by the Auditor
df = load_sample("loan")
# Download data_policy.oscal.yaml from:
# https://github.com/venturalitica/venturalitica-sdk-samples/blob/main/scenarios/loan-credit-scoring/policies/loan/data_policy.oscal.yaml
results = vl.enforce(
data=df,
target="class",
gender="Attribute9", # Mapping gender
age="Attribute13", # Mapping age
policy="data_policy.oscal.yaml"
)
# The session trace file is saved inside the run directory
# and will prove NOT just the result, but HOW it was computed.
# After the context manager exits, check the evidence directory:
# .venturalitica/
# results.json <- Latest compliance results
# runs/loan_audit_v1_<timestamp>/
# trace_loan_audit_v1.json <- Full execution trace
# results.json <- Per-run compliance results
# bom.json <- Software bill of materials

After running the audit, launch the UI:

Terminal window
venturalitica ui

Navigate to “Article 13: Transparency”.

Look for the Evidence Hash in the dashboard. Evidence Hash: 89fbf...

This hash is your “Digital Seal”. If you change one pixel in the dataset or one line in the policy, this hash changes. You can now prove to a regulator exactly what happened during the audit.

The Dashboard translates JSON evidence into the language of the EU AI Act.

LawDashboard TabWhat to Answer
Art 9Risk Management”Did we verify bias < 0.1?” (Your Policy)
Art 10Data Assurance”Is the training data representative?”
Art 13Transparency”What libraries (BOM) are we using?“
  1. Don’t Trust, Verify: The Trace File (captured automatically via monitor()) is the source of truth for the entire execution context.
  2. Glass Box Audit: Compliance isn’t a “pass/fail” boolean; it’s a verifiable history of execution.
  3. Immutable Proof: The Evidence Hash allows you to prove the integrity of the audit process.

Go to Level 4: The Architect