Part XIII: Trust, Safety, Evaluation, and Operations
Chapter 70: Responsible Sensory AI and Regulation

Security of physical-world AI

"I was trained to trust my sensors. Nobody mentioned that my sensors could be trained to lie to me."

A Recently Compromised AI Agent

The Big Picture

Ordinary software security defends bytes: the data at rest, the code, the network. A physical-world AI system defends something softer and stranger, its perception of reality. An attacker does not need to breach your server if a sticker on a stop sign, a $30 signal generator, or a handful of poisoned training clips can make your model believe a comfortable falsehood. This section is the security counterpart to the fairness and privacy duties of the rest of Chapter 70: security is a responsibility, not just an engineering nicety, because a sensing system that can be steered by an adversary can be steered into harm. We build the threat surface unique to sensing, name the four adversarial-machine-learning attack classes, follow the model and data supply chain end to end, and lay out defense in depth as a governance obligation you can put in a checklist and audit against.

This section assumes the sensor fault vocabulary and the physics of spoofing from Part XIII, specifically the functional-safety and sensor-spoofing mechanics of Chapter 68 and the industrial-control intrusion detection of Chapter 38. Those chapters teach how to detect a corrupted input; here we take the adversary's-eye view and ask, across the whole lifecycle, who can make the system wrong, and what we owe the people affected when they try.

Why physical-world AI has a bigger attack surface

A cloud classifier receives its inputs through an authenticated API. A sensing system receives its inputs through the open physical world, which no firewall covers. That single fact widens the attack surface along three axes. First, the signal channel is public: anyone within line of sight, radio range, or acoustic range of a sensor can inject energy into it. Second, the transduction is exploitable: an adversary who understands that a MEMS gyroscope has a mechanical resonance, or that a camera's rolling shutter samples rows in sequence, can craft a physical stimulus that the sensor faithfully converts into a malicious digital reading. Third, the model itself is an asset that ships to the edge, where it can be extracted, inverted, or fooled at leisure. Security for physical-world AI therefore has to reason about the confidentiality, integrity, and availability (the classic CIA triad) of three things at once: the raw signal, the model, and the training data that shaped it.

It helps to score exposure rather than treat every component as equally at risk. A crude but useful risk index for a component multiplies how reachable it is, how much an attacker gains, and how likely a successful attack goes unnoticed:

$$ R = \underbrace{P_{\text{access}}}_{\text{reachability}} \cdot \underbrace{I_{\text{impact}}}_{\text{consequence}} \cdot \underbrace{(1 - P_{\text{detect}})}_{\text{stealth}}. $$

The term that most often dominates in sensing systems is the last one. A physically spoofed but in-range measurement, exactly the stuck-and-plausible failure of Chapter 68, has a low \(P_{\text{detect}}\) and so a high \(R\) even when the impact is moderate. Security effort should follow \(R\), which usually means investing in detection and cross-checks rather than only in perimeter hardening.

Key Insight

In conventional security the crown jewel is the data; in physical-world AI the crown jewel is often the sensor's credibility. An attacker who can make one trusted sensor report a plausible lie has done more damage than one who crashes it, because the lie propagates silently through fusion and control while the crash trips a heartbeat alarm. This inverts a common intuition: availability attacks (jamming, denial) are loud and self-limiting; integrity attacks (spoofing, poisoning) are quiet and compounding. Budget your defenses for the quiet ones.

A threat taxonomy: four ways to attack a model

Adversarial machine learning organizes attacks by what the adversary manipulates and when. Four classes cover almost everything you will face in a sensing deployment.

These map cleanly onto the CIA triad: evasion and poisoning attack integrity, jamming attacks availability, extraction and inversion attack confidentiality. Naming the class tells you where in the lifecycle the control belongs, at the sensor, in the data pipeline, or around the served model.

Step-Through: the poisoned patrol robot

A warehouse deploys autonomous inventory robots whose obstacle model is retrained nightly on the day's fleet camera footage, an online-learning loop of the kind covered in Chapter 59. A contractor with badge access tapes an unremarkable orange logo onto three pallets for a week. The label pipeline, trusting fleet data, ingests thousands of frames where "orange logo" co-occurs with "safe to drive through." A backdoor forms: any pallet wearing that logo is now classified as passable. On paper the model's held-out accuracy is unchanged, because the trigger appears in no clean test set. The exploit surfaces only when a logo-tagged pallet, actually loaded with product, is driven into. The post-incident fix was threefold: provenance tags on every training frame (which camera, which shift, which robot), a poisoning audit that flags labels whose support collapses onto a single visual token, and a rule that fleet-collected data is quarantined and human-sampled before it can move a weight. Security here was a data-governance problem wearing a robotics costume.

The model and data supply chain

Most real compromises do not come from a clever gradient; they come from an unsigned artifact. A modern sensor model is assembled from a pretrained backbone (often downloaded from a public hub), third-party datasets, an open-source training stack, quantization and compilation tools, and an over-the-air update channel to the fleet. Every hop is a place to inject a backdoor or a trojaned dependency. Treating the model like any other software artifact, with a bill of materials, cryptographic signing, and verified provenance, closes the cheapest attacks. The principle is simple: a device should refuse to run a model whose origin it cannot verify, exactly as a browser refuses an untrusted certificate. The snippet below shows the minimum viable check an edge device should perform before loading a model, verifying an HMAC signature over the exact bytes it is about to execute.

import hmac, hashlib

def verify_model(model_bytes: bytes, signature_hex: str, key: bytes) -> bool:
    """Refuse to load a model artifact whose signature does not match.
    key is a per-fleet secret provisioned at manufacture; signature_hex
    is shipped alongside the artifact by the trusted build server."""
    expected = hmac.new(key, model_bytes, hashlib.sha256).hexdigest()
    # constant-time compare avoids a timing side channel on the tag
    return hmac.compare_digest(expected, signature_hex)

# On device, before handing weights to the runtime:
blob = open("obstacle_net.q8.bin", "rb").read()
if not verify_model(blob, sig_from_manifest, FLEET_KEY):
    raise SystemExit("untrusted model artifact: refusing to load")
load_and_run(blob)
Code 70.4.1: A device-side integrity gate. The HMAC ties a signature to the exact model bytes; a single flipped weight from a tampered OTA update changes the tag and the load is refused. compare_digest is used instead of == so an attacker cannot learn the correct tag byte by byte from response timing. This is the "verify provenance before execution" rule made concrete.

Code 70.4.1 is deliberately minimal to show the shape of the control; a fleet in production wants asymmetric signatures, a rotating key hierarchy, and a transparency log, none of which you should hand-roll.

Right Tool: signing and provenance without the crypto footguns

Rolling your own key management, transparency log, and signature verification is roughly 300 to 500 lines of security-critical code you do not want to own. A model-signing toolchain such as Sigstore's model-transparency library reduces "sign this model and verify it on device" to about five lines: sign(model_path, identity) at build, verify(model_path, expected_identity) at load. It handles the hashing of large multi-file artifacts, keyless signing tied to a workload identity, and the append-only transparency log that lets you prove after the fact which build produced which weights. You write policy, not cryptography.

Defense in depth as a governance duty

No single control stops all four attack classes, so security for physical-world AI is layered, and the layering is a responsibility you should be able to show an auditor. A workable stack has four tiers. At the signal tier, add redundancy and physical authentication: cross-check independent modalities so a spoof must fool all of them at once (the missing-modality and fusion logic of earlier parts is also your anti-spoofing logic), and where possible use sensors with built-in challenge-response or physical-layer fingerprints. At the data tier, enforce provenance, quarantine fleet-collected data, and run poisoning and backdoor audits before any retrain touches production weights. At the model tier, sign artifacts, rate-limit and monitor query patterns to blunt extraction, and consider adversarial training where the threat justifies its accuracy cost. At the operations tier, keep an incident-response plan, an audit log, and the ability to roll back a model fleet-wide in minutes, because the responsible question after a compromise is not only "is it fixed" but "who was harmed and how do we tell them," which is the accountability thread of Section 70.7. Agentic sensing systems that can take actions in the world (Chapter 22) raise the stakes of every tier, because a compromised perception now drives a compromised action.

Exercise

Take a smart doorbell camera that unlocks the door on recognizing the owner's face. (a) Classify three plausible attacks against it into the four-class taxonomy (evasion, poisoning, backdoor, extraction/inversion). (b) For each, compute a rough risk index \(R = P_{\text{access}} \cdot I_{\text{impact}} \cdot (1 - P_{\text{detect}})\) on a 1-to-5 scale per factor, and rank them. (c) Assign each ranked threat to the defense tier (signal, data, model, operations) that most cheaply reduces its \(R\), and justify why perimeter hardening alone leaves the top threat largely untouched.

Self-Check

  1. Why is an integrity attack (a plausible spoofed reading) generally higher-risk than an availability attack (jamming) for a fusion-based perception stack, in terms of the \(R\) index?
  2. A model passes every held-out accuracy test yet misbehaves on a specific painted symbol in the field. Which attack class is this, and why do standard benchmarks fail to catch it?
  3. Your team downloads a pretrained backbone from a public hub and fine-tunes it on sensor data. Name two supply-chain controls from this section that reduce the risk that the backbone carries a hidden backdoor.

What's Next

In Section 70.5, we turn from defending the pipeline to documenting it: dataset governance through datasheets and dataset cards, the artifacts that make provenance, consent, and known limitations legible to the people who reuse your data, and that turn the poisoning and privacy defenses of this section into a paper trail an auditor can actually follow.