Physical AI
The Physical AI surface is for actions that affect the real world.
This is one of the commercial surfaces of the Ratify Verify console. The same protocol can also be implemented independently if you do not want the managed product.
Canonical protocol references:
Examples:
- robot operation
- robot movement
- vehicle operation
- drone flight
- infrastructure control
- actuator access
What the surface does
Section titled “What the surface does”Physical AI uses the same Ratify proof bundle flow, but the verifier usually runs on-device or at the edge.
The device or controller checks:
- who authorized the action
- what scope was granted
- whether the delegation is still valid
- whether the current context satisfies the constraints
If the proof fails, the device should fail closed.
SDKs are available in Go, TypeScript, Python, Rust, and C/C++. The C/C++ SDK ships libratify_c.a (static) and libratify_c.so (shared) with a cbindgen-generated header, supports RTOS targets (FreeRTOS, Zephyr) via custom entropy, and is no_std + alloc compatible for embedded deployments. See the C/C++ SDK page for build instructions and target matrix.
Typical flow
Section titled “Typical flow”sequenceDiagram autonumber participant Admin as Org Admin participant App as Control Plane participant Device as Robot / Vehicle / Controller participant Ratify as Ratify SDK / Policy
Admin->>App: Authorize device or mission App->>Ratify: Issue delegation for physical scope Device->>Ratify: Request verification or challenge Ratify-->>Device: Challenge / verification request Device->>Device: Sign challenge with SDK Device-->>Ratify: Proof bundle Ratify->>Ratify: Verify scope + constraints + revocation Ratify-->>Device: Allow or denySDK examples
Section titled “SDK examples”result := ratify.Verify(bundle, ratify.VerifyOptions{ RequiredScope: ratify.ScopeRobotOperate,})if !result.Valid { panic("deny actuation: " + result.ErrorReason)}const result = await verifyBundle(bundle, { required_scope: SCOPE_ROBOT_OPERATE,});if (!result.valid) { throw new Error(result.error_reason);}result = verify_bundle(bundle, VerifyOptions(required_scope=SCOPE_ROBOT_OPERATE))if not result.valid: raise PermissionError(result.error_reason)let result = verify_bundle( &bundle, &VerifyOptions { required_scope: SCOPE_ROBOT_OPERATE.into(), ..Default::default() },);assert!(result.valid, "{}", result.error_reason);/* Embedded controller: verify before actuating. Runs offline — no network call at verify time. */#include "ratify.h"#include <time.h>#include <stdio.h>
int authorize_actuation(const char *bundle_json) { RatifyVerifyResult *result = NULL; char *err = NULL;
/* Simple path: scope check only, use system clock */ ratify_verify_bundle(bundle_json, "robot:operate", (int64_t)time(NULL), &result, &err);
int authorized = ratify_verify_result_is_valid(result); if (!authorized) { char *status = ratify_verify_result_identity_status(result); fprintf(stderr, "actuation denied: %s\n", status); ratify_string_free(status); }
ratify_verify_result_free(result); ratify_error_free(err); return authorized;}With geo-constraints (robot must be within an authorized zone):
RatifyVerifierContext ctx = {0};ctx.current_lat = 47.6062;ctx.current_lon = -122.3321;ctx.has_location = 1;
RatifyVerifyOptions opts = {0};opts.required_scope = "robot:operate";opts.context = &ctx;
RatifyVerifyResult *result = NULL;char *err = NULL;ratify_verify_bundle_opts(bundle_json, &opts, &result, &err);
if (!ratify_verify_result_is_valid(result)) { /* Constraint denied, expired, revoked, etc. — fail closed */ halt_actuation();}ratify_verify_result_free(result);ratify_error_free(err);For RTOS targets (FreeRTOS, Zephyr) register your hardware TRNG before issuing any delegation or challenge:
static int board_entropy(uint8_t *buf, size_t len) { /* STM32 HAL example — replace with your platform TRNG */ for (size_t i = 0; i < len; i += 4) { uint32_t rnd; if (HAL_RNG_GenerateRandomNumber(&hrng, &rnd) != HAL_OK) return -1; size_t copy = (len - i < 4) ? (len - i) : 4; memcpy(buf + i, &rnd, copy); } return 0;}
/* Call once at board init, before any ratify_* call */ratify_set_entropy_source(board_entropy);Build against the static library (no OS dependencies):
# Cross-compile for ARM Cortex-M4 (STM32, NXP)cargo build --release --target thumbv7em-none-eabihf \ --features custom-entropy
# Link in your firmware buildarm-none-eabi-gcc main.c \ -I ratify-c/include \ -L ratify-c/target/thumbv7em-none-eabihf/release \ -lratify_c -o firmware.elfSee the C/C++ SDK page for the full target matrix and API reference.
Scope examples
Section titled “Scope examples”Use robot:operate for high-level operation permission, robot:move for motion-only authorization, vehicle:operate for drive/flight systems, physical:actuate for direct actuation, and infrastructure:control or infrastructure:access for plant, building, or equipment control.
Infrastructure example
Section titled “Infrastructure example”For infrastructure control, use infrastructure:control or infrastructure:access and bind the verifier context to the actual device state, location, time window, or other operational guardrails. That matters when the caller is not a person but a robot, PLC, controller, or remote operator.
The important part is the same: the platform proves authorization, and the device enforces it before it moves the world.
If you are building firmware, the integration point is the same proof bundle and verifier semantics, just compiled down into the embedded controller. The C/C++ SDK is available now — link against libratify_c.a and wire in your hardware TRNG via ratify_set_entropy_source() for RTOS targets.