Create a verification for a Python function
- Install the Prado CLI
-
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
-
Create a file called
input.json:This represents the data the system used to make its decision. - Use the Prado CLI to execute the function and generate a receipt:
- 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
- After execution, a new file called receipt.json is created.
-
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
- that the decision was correct
- that the logic is optimal
- Verify the receipt:
• re-runs the function locally
• recomputes the hashes
• checks that they match the receipt