mithril-security / blindai

Confidential AI deployment with secure enclaves :lock:
https://www.mithrilsecurity.io/
Apache License 2.0
502 stars 36 forks source link

Execution exports #37

Closed cchudant closed 2 years ago

cchudant commented 2 years ago

Description

For the Signed Responses feature (#13) to be useful, we need a way to export and validate execution proofs.

Here is the proposed API:

response = client.run_model(run_inputs, sign=True)
response.save_to_file("./execution_proof.json")
from blindai.client import load_execution_file

response = load_execution_file("./proof_of_execution.json")
response.validate(policy_file="./policy.toml") # throws if invalid or execution is not signed
print("The proof is valid!")

We should also have these functions:

response.export_binary() :: bytes
from blindai.client import load_execution_binary
response = load_execution_binary(a :: bytes)

Unanswered questions

Motivation and Context

For the Signed Responses feature (#13) to be useful, we need a way to export execution proofs.

Affected Features

Signed Responses feature (#13)

Test Plans

Add tests and unit-tests.

Additional Information

None

Checklist

cchudant commented 2 years ago

I want your thoughts on that @JoFrost before assigning it to myself and start working on it

JoFrost commented 2 years ago

I am not against it. Go for it,

JoFrost commented 2 years ago

And yes, CBOR is the way to go imo

cchudant commented 2 years ago

Currently working on it :)