TruehandsDocs
engine 0.4.0 API Back to site

DocsTruehands Audit

How the checks work

What the engine (version 0.4.0) does with each clip, in the order it does it. Every threshold on this page is read from the engine's source when these docs are built; the tables name the file. The thresholds were set on the calibration half of the benchmark and on the simulated pilot; real programs need calibration on their own held-out footage before they drive payment.

Intake, before anything is decoded#

Every submission is its own job. Intake decides whether a file is analysed at all and how many seconds of video it holds.

The strict reader. Every read of a submitted file forces the MP4/MOV demuxer (-f mov), allows only the local file protocol (-protocol_whitelist file) and decodes only the first video stream, so FFmpeg never guesses a format from the content. The engine image ships an FFmpeg build that contains only the MOV demuxer, the H.264 and HEVC decoders and the file and pipe protocols.

The rules, in order:

  1. The manifest row has valid ids and its file exists inside the program folder; the clip id is not repeated. Otherwise invalid_manifest.
  2. The file is at most the program's byte limit, else over_limits.
  3. It is an MP4/MOV container with a video stream, else unreadable_file.
  4. It has exactly one video stream, else ambiguous_streams.
  5. The codec is one of h264, hevc, else codec_not_allowed.
  6. Width × height is at most 8,294,400, else over_limits.
  7. Its measured length is within the program's limit, else over_limits.

Measured seconds. The video packets are counted without decoding and divided by the declared frame rate, clamped to 15-120 fps, so a header claiming 1 fps cannot turn 150 frames into two and a half minutes. The result is never more than the stream's own timestamps, and the container duration is never used. If frame count and timestamps disagree by more than 5%, the clip is flagged timing_mismatch and paid on the smaller.

Exact copies. The engine hashes the coded packets of the first video stream with SHA-256. That hash does not change when a file is remuxed, retagged or given another audio track, so a re-wrapped copy of an earlier submission is rejected at intake (self_duplicate or cross_contributor_duplicate, exact) and never decoded. You can compute the same hash:

Shell
ffmpeg -v error -f mov -protocol_whitelist file -i clip.mp4 -map 0:v:0 -c copy -f hash -hash sha256 -

Decoding. Frames are decoded in chunks, so memory stays flat however long the clip is. Each decode pass runs under a deadline of 120 seconds plus 4 seconds per second of video, counting only time spent waiting on the decoder. A pass that runs out of time holds the clip as decode_timeout (our machine, not the contributor, is the likely cause); a stream with decoder errors is flagged decode_errors.

ConstantValueNote in the code
ALLOWED_CODECSh264, hevc
MAX_BYTES8,589,934,592 (8 GiB)
MAX_SECONDS3600
MAX_PIXELS8,294,400
FPS_FLOOR15Declared frame rates outside this band are clamped when turning a frame count into seconds, so a header claiming 1 fps cannot turn 150 frames into two and a half minutes.
FPS_CEIL120Declared frame rates outside this band are clamped when turning a frame count into seconds, so a header claiming 1 fps cannot turn 150 frames into two and a half minutes.
TIMING_TOLERANCE0.05
DECODE_TIMEOUT_BASE_S120 (2 minutes)A decode pass that takes longer than this is stopped: base seconds plus seconds per second of video.
DECODE_TIMEOUT_PER_S4

From truehands/media.py.

What the engine extracts#

For every clip that passes intake, once, cached by the video stream hash:

  • CLIP embeddings (OpenCLIP ViT-B/32, LAION-2B weights pinned by hash) at 2 frames per second, for the frames as they are and mirrored;
  • a perceptual hash (64-bit pHash) of the same frames, as they are and mirrored;
  • one pass over every frame at the native rate, in gray at 160 px wide: the motion energy per second and the frame cadence (how much each frame changes from the one before);
  • the camera rotation speed from optical flow at 15 fps, only for clips sent with a sensor log;
  • four thumbnails, face-blurred before they are saved;
  • face counts on one of those frames every 2 s (at most 60 a clip, spread over a longer one), with the face model that blurs evidence, counting only detections that score 0.8 or more (blurring takes everything from 0.5, which in first-person footage includes hands and boxes). audit.json records them as faces (sampled_frames, frames_with_faces, max_faces), or null when they could not be counted. They change no verdict and no pay.

Changing a threshold therefore re-decides a whole program in about a minute, without decoding it again.

Copy alignment#

The central question for paid footage: is this clip a copy of one submitted earlier, by the same contributor or by someone else, possibly mirrored, cropped, recolored, re-encoded, re-timed or played backwards?

Frame similarity alone cannot answer it. A contributor filming the same kitchen on another day, or a factory worker repeating one task at one workstation, produces frames that look like each other. What a copy has that honest repeated work does not is order: its frames line up with the original's at a single time offset, on one straight line.

How a match is found. For a clip A and an earlier clip B:

  1. B is a candidate only if some frame of A (as is, or mirrored) has cosine similarity of at least 0.85 to some frame of B.
  2. Each frame of A keeps its three most similar frames of B, if they reach 0.85.
  3. The engine fits lines j = slope · i + offset through those pairs, for 41 playback speeds log-spaced from 0.5× to 2× (np.exp(np.linspace(np.log(0.5), np.log(2.0), 41))). A pair is on a line if it is within one frame of it. A line's score is the number of distinct frames of A and of B it explains (the smaller of the two).
  4. The best line has the most frames, then the highest mean similarity.
  5. coverage is the best line's score as a share of the shorter clip. distinct is how far it beats the best line at least 6 frames (3 s) away at mid-clip, as a share of the shorter clip. Shares are taken of at least 20 frames (10 s), so a handful of chance matches cannot look like most of a very short clip.

Variants. A is tried as it is, mirrored, played backwards, and mirrored and backwards; the variant with the highest distinct wins, if it has at least 6 aligned frames. Evidence pairs always index A's frames in their original order.

The decision.

MatchRejected whenSent to review when
Another contributor's earlier clipcoverage ≥ 0.5 and distinct ≥ 0.45coverage ≥ 0.3 and distinct ≥ 0.3
The same contributor's earlier clipcoverage ≥ 0.5 and distinct ≥ 0.45coverage ≥ 0.3 and distinct ≥ 0.4

A contributor's own repetitive work reaches a distinct of about 0.40 on the benchmark's calibration half, which is why a match with their own clip needs more before it reaches review. A policy can move these thresholds within the engine's floors; see Policies.

The evidence names the matched clip and its contributor, the coverage, distinct, speed, time offset and variant, and the share of aligned frames that are pixel-identical (perceptual hash within 12 of 64 bits). Below half, the detail says "re-encoded or altered"; a speed more than 5% from 1× is stated. Two face-blurred evidence frames show a matched pair at its timecode.

Which clips are compared. Within a run, each clip is compared with every earlier clip of the run, in submission order, so the copy is always the later clip. Truehands Cloud then compares finished runs with everything the organisation audited before: see cross-run memory.

ConstantValueNote in the code
MATCH_SIM0.85frame-to-frame cosine similarity for a candidate match
MATCH_MIN_FRAMES6aligned frames needed before a match counts
DUP_COVERAGE0.5share of the shorter clip that must align to call it a copy
DUP_DISTINCT0.45...and by how much that alignment must beat any other time offset
WEAK_COVERAGE0.3partial overlap: send to review
WEAK_DISTINCT0.3
SELF_REVIEW_DISTINCT0.4A contributor's new clip of the same workstation and task looks like their earlier ones by nature (repetitive factory work reaches 0.40 in the benchmark's calibration half), so a self-duplicate needs more to go to review.
FAR_OFFSET_FRAMES63 s: alignments this far apart count as different moments
SPEEDSnp.exp(np.linspace(np.log(0.5), np.log(2.0), 41))Playback speeds a copy may have been re-timed to, log-spaced from half to double speed.
ALIGN_MIN_FRAMES2010 s: coverage and distinct of shorter clips are counted against this many frames

From truehands/checks.py.

Public dataset matching#

The same matcher runs against a reference library: every .mp4 in the folder passed as --reference. Footage lifted from a public dataset is rejected as public_dataset_match when coverage ≥ 0.5 and distinct ≥ 0.4. Nobody's own workstation is in the library, so there is no review band and no self-match allowance. A reference video that cannot be read is skipped and listed in references_skipped; it never fails the run.

In the demo, the reference library is a few clips of a public factory dataset. In production, point it at the datasets your contributors could plausibly copy from and that you are licensed to use.

ConstantValueNote in the code
REF_COVERAGE0.5Public-dataset footage has no such confound (nobody's own workstation is in the reference library).
REF_DISTINCT0.4

From truehands/checks.py.

Idle time#

The motion energy of each second is the mean absolute change, on a 0-255 gray scale at 160 px, between frames sampled 5 times a second. A second below 1.2 is idle. Runs of at least 4 idle seconds are cut from pay; shorter pauses are normal. A clip with 4 or more idle seconds gets idle_time and partial pay: its length minus the idle seconds. A policy can raise the minimum run (up to 60 s) or send heavily idle clips to review (idle_review_share).

ConstantValueNote in the code
IDLE_ENERGY1.2per-second motion energy below this is idle
IDLE_MIN_RUN4seconds; shorter pauses are normal

From truehands/checks.py.

Internal repeats#

Looping a clip's own footage passes every check that compares one clip with another, and shows motion all the way through. The engine compares the clip with itself at every lag of 6 frames (3 s) or more, as it is and mirrored. A stretch counts as a repeat when, for at least 6 consecutive frames (3 s), each frame matches the earlier footage both semantically (CLIP similarity ≥ 0.975) and in pixels (perceptual hash within 12 bits), and the stretch itself changes by at least 14 bits, so that a still view is not mistaken for a loop. Repeated seconds are counted once, on the later copy, and cut from pay as internal_repeat.

ConstantValueNote in the code
REPEAT_MIN_LAG63 s: a stretch must come back at least this much later to count as a repeat
REPEAT_MIN_RUN63 s of consecutive frames must repeat
REPEAT_SIM0.975per-frame similarity of a repeat (calib: loops 0.99+, honest revisits under 0.97)
REPEAT_HAM12...and perceptual-hash distance (of 64 bits)
REPEAT_DIVERSITY14the repeated stretch must itself change this much (bits), so a still view is not a loop

From truehands/checks.py.

Slowed playback#

A clip stretched by duplicating frames looks smooth and passes the idle check. At the native frame rate, a repeated frame is one whose neighbours move (one of the two neighbouring changes is at least 1.5) while it barely changes: less than 0.35 (nearly the same image), or less than 25% of the smaller neighbouring change (a re-encoded duplicate is not pixel-identical). The clip is flagged slowed_playback when at least 10% of its moving frames are repeats and they add up to at least 2 s; those seconds are cut from pay.

Not caught: slowing with interpolated in-between frames, and slowing followed by a heavy re-encode whose B-frames turn duplicates into in-between frames.

ConstantValueNote in the code
SLOWED_MIN_SHARE0.1share of moving frames repeating the one before (calib: honest 0.011 at most, x1.5 0.198)
SLOWED_MIN_SECONDS2...and at least this many seconds of pay must come from repeated frames
REPEAT_RATIO0.25a frame that changes under a quarter as much as both its neighbours repeats the last one

From truehands/checks.py.

ConstantValueNote in the code
REPEAT_DIFF0.35mean gray change (0-255, 160 px) below which a frame repeats the one before it
REPEAT_CONTEXT1.5...counted only when a neighbouring frame pair changes at least this much

From truehands/features.py.

Task check#

Is the clip of the task the contributor claims? Two tests, and both must say no before the clip is flagged.

Zero-shot text ranking. Each task of the program is embedded with three prompts ("a first-person video of a person …", "a photo taken from a head-mounted camera of someone …", "egocentric view: …"), averaged. The clip's mean frame embedding is scored against every task. The claim fails when it ranks below #5 for the whole clip and is among the top three for fewer than 10% of frames.

The program-footage veto. Honest contributors outnumber mislabellers in any program worth auditing, so the program's own footage of a task is a better reference than a text prompt, above all for work CLIP has no words for, such as factory assembly. When at least 5 other clips claim the same task, the engine compares this clip with their mean (leaving the clip itself out). The clip is consistent with its claim, and the text model is overruled, when it is no more than 0.02 further from its task's footage than from any other task's, and no more than 0.03 further than a typical member of its task (the 10th percentile of members' similarities).

task_mismatch only ever sends a clip to review. CLIP is good at telling folding laundry from mopping and weak on fine distinctions such as slicing carrots versus cucumbers.

ConstantValueNote in the code
TASK_MAX_RANK5claimed task ranked below this for the whole clip...
TASK_MIN_FRAME_SHARE0.1...and in the top 3 for fewer than this share of frames
TASK_PROTO_MIN_CLIPS5other clips claiming a task before the program's own footage of it is a reference
TASK_PROTO_MARGIN0.02a clip is consistent with its claim unless another task's footage is this much closer
TASK_PROTO_SPREAD0.03...or it sits this much further from its task than a typical clip of that task does

From truehands/checks.py.

Sensor check and log validation#

A phone records its own rotation in the gyro log. If the log really came from the recording, the gyro and the camera motion in the picture rise and fall together. A log swapped in from another recording does not track the picture, and a still phone filming a monitor shows motion in the picture with none in the gyro.

Validation first. A log the engine cannot trust is a finding about the submission (sensor_log_invalid, review), never an engine failure. The log must:

  • exist inside the program folder and be at most 64 MiB;
  • have at least 50 rows of numbers, the first four columns being time in seconds and gyro x, y, z in rad/s (a header row is optional; more columns are ignored);
  • have only finite values and strictly increasing timestamps;
  • run at 20-2000 Hz;
  • cover at least 50% of the video, with time measured from the first frame.

Truehands Cloud is stricter at upload: the header must be exactly ['t', 'gx', 'gy', 'gz', 'ax', 'ay', 'az'] with numeric rows of 7 columns, at most 20 MiB.

The check. The camera's rotation speed is estimated from the picture: corners are tracked between consecutive frames at 15 fps, a similarity transform is fitted with RANSAC, and its translation and in-plane rotation become an angular speed using the focal length of a roughly 100° head camera. The gyro magnitude is averaged into the same time bins; both series are smoothed over five samples; their correlation is taken at the best lag within ±0.4 s.

ResultConditionVerdict
Still phone, moving picturemean gyro < 0.06 rad/s while the picture moves > 0.2 rad/sreject (sensor_mismatch)
No correlationcorrelation < 0.3 while the picture moves > 0.12 rad/sreject (sensor_mismatch)
Weak correlation0.3 ≤ correlation < 0.5 with the same motionreview (sensor_mismatch)

On the benchmark's calibration half, honest logs correlate at 0.93 or more and swapped or shifted ones below 0.41. A clip too short to compare (fewer than 12 samples) is skipped and says so.

ConstantValueNote in the code
IMU_MIN_CORR0.3gyro vs image-motion correlation below this: the log is not this video's (reject)
IMU_REVIEW_CORR0.5...below this: held for review (calib: honest logs 0.93+, swapped or shifted ones <0.41)
IMU_STILL_GYRO0.06rad/s: phone essentially not moving
IMU_MOVING_VIDEO0.2rad/s: picture clearly moving (for the still-phone rule)
IMU_CORR_MIN_VIDEO0.12rad/s: enough camera motion in the picture for the correlation to mean something
IMU_MAX_BYTES67,108,864 (64 MiB)
IMU_MIN_SAMPLES50
IMU_RATE_HZ20, 2000
IMU_MIN_COVERAGE0.5

From truehands/checks.py.

Signed capture#

When a program turns it on, every clip can carry an Ed25519 signature made on an enrolled device over the video stream hash and the sensor log. The engine verifies the signature, the device, the stream, the log, the length, the collection window and the nonce; anything that does not check out is attestation_invalid (reject), and a missing signature in a program that requires one is attestation_missing (review). Pixels and sensor logs can both be faked well enough to pass the checks above; a signature made in the device's secure hardware cannot. The contract is on Signed capture.

Provenance#

When program.json names a capture_app, a file without that tag in its metadata (edited or exported elsewhere) is flagged not_from_capture_app. A file whose creation_time tag equals an earlier clip's in the run is flagged reused_capture_timestamp. Both go to review. Tags are easy to forge, so neither is ever a reason to reject on its own, and the benchmark does not count an attack as caught if only these flags fired.

Known limits#

What the engine does not catch today, and why. The benchmark measures each of these.

  • Heavily edited copies. Grayscale, strong noise, a crop to half the frame, picture-in-picture, very heavy compression (crf 46) and heavy combinations. In CLIP space such a copy sits further from its source (median similarity 0.64-0.84) than honest repeated work sits from itself (median 0.83, up to 0.97), so no threshold separates them. Closing this needs a copy-detection descriptor trained for such edits.
  • Sensor logs computed from the video. A gyro log synthesised from the picture matches it perfectly. Only signed capture stops it.
  • Screen re-recording without a sensor log. Today only the sensor check catches a phone filming a monitor.
  • Slowed footage hidden by re-encoding. A codec with B-frames rebuilds a duplicated frame as the average of its neighbours, which is interpolation; slowing 2× and re-encoding at crf 40 is not caught. Signed capture with a signed length closes it.
  • A wrong task whose real task has no examples. With fewer than 5 other clips of the real task in the program, there is no program footage to compare with.
  • Partial copies. Some clips with 30% of someone else's footage inside go to review, some pass.
  • AI-generated video. Truehands does not detect it. Signed capture is the answer: a generated video was never recorded on an enrolled device.
  • Scale. The within-run search compares every pair of clips. Programs of tens of thousands of clips per run need an approximate nearest-neighbour index, with candidates verified by the exact alignment as cross-run memory already does.
  • Calibration. The sensor thresholds were calibrated on 13 clips from one headset. The attacks in the benchmark were written by the people who wrote the detectors. Real fraud will be more varied and will adapt once it is caught. A shadow pilot on your own footage is how these numbers get measured for your program.