Skip to main content

Create a verification for a Python function

  1. Install the Prado CLI
NOTE: Make sure to have the Go binaries in your path Then, verify the installation:
  1. Create a file called decision.py. This function takes an input object and decides whether to ALLOW or BLOCK an action based on a risk score.
    This function is deterministic:
    • given the same input
    • it always produces the same output
    This makes it suitable for verification.
  2. Create a file called input.json:
    This represents the data the system used to make its decision.
  3. Use the Prado CLI to execute the function and generate a receipt:
What happens here:
  • Prado executes the Python function with the given input
  • The input and output are canonicalized and hashed
  • A receipt is generated that commits to:
    • the input
    • the output
    • the runtime used
  1. After execution, a new file called receipt.json is created.
The receipt does not contain raw data. It contains cryptographic commitments to what was executed.
  1. With this receipt, anyone can later verify that:
    • a Python function was executed
    • with a specific input
    • producing a specific output
    • under a known runtime
    The receipt does not claim:
    • that the decision was correct
    • that the logic is optimal
    It proves what happened, not whether it was right.
  2. Verify the receipt:
This:
• re-runs the function locally
• recomputes the hashes
• checks that they match the receipt