A device with its own passport sends data over its Wi-Fi through a checkpoint to the database, set up by an agent, with the keys approved by a human.

This is the closing article of the series “Production details”. The nine articles before it each covered one detail that a prototype usually leaves out. Here they come together as one checklist. An engineer can review it in five minutes, and a coding agent can follow it before it writes device code.

Why is the first firmware different from a web app?

The first firmware is different because everything you do not put into it can only be added later by a firmware update. That update needs an update channel, and the channel too has to be in the first firmware. A web app can be fixed tomorrow. A sensor in a customer’s building runs the code it shipped with until an update reaches it. So most problems in the field were decided on the bench, often months before they appear.

Why does a coding agent need explicit rules?

A coding agent needs explicit rules because it builds what the prompt and its context ask for. Details that only matter months later are easy to leave out when the prompt is about getting data from a device into a database. Such details are certificate renewal, root rotation, behaviour after an outage or records for an authority. Veracode’s 2025 study gave more than 100 models 80 coding tasks with a secure and an insecure way to solve them, and the models chose the insecure one in 45% of cases (Veracode). Rules in the agent’s context turn these details into requirements it can check its work against.

PartQuestion to check in a prototypeRule below
IdentityDoes every device have its own key, generated on the device?1
CertificatesDo certificates renew, is the date check on, is the root under your control?2, 3, 4
Data pathAre devices off the app’s database limits, and do they back off after an outage?5, 6
Device stateDoes the app read a twin instead of asking the device?7
UpdatesIs there a signed update path with rollback?8
RecordsAre versions, updates and identities recorded from the first device?9, 10

What are the ten production rules?

The ten rules are the minimum a connected device product needs in its first firmware. Each links to the article that explains it.

  1. Every device gets its own identity, and its private key is generated on the device. One lost device must never expose the fleet. One key for every device.
  2. Device certificates renew automatically inside a renewal window, and there is a recovery path for devices that missed it. The end date is printed when the certificate is issued. What happens when a device certificate expires.
  3. Certificate date checks are turned on, and the device sets its clock before the first TLS connection. ESP-IDF ships with the check off, and after a power cut the clock of an ESP32 restarts at 1970. Why an ESP32 needs the right time before TLS.
  4. Devices trust a long-lived private root that you control, not a public server certificate. Public certificates shrink to 47 days. 47-day certificates.
  5. Devices never connect to the application database or share its limits. A buffer stands between them from the first device.Why can IoT devices take a website down?.
  6. Reconnects use exponential backoff with jitter, never a fixed retry interval. An outage synchronises the fleet. Reconnect storms.
  7. Apps read and write device state through a twin, never directly to a sleeping device.How apps talk to an ESP32 that sleeps.
  8. The first firmware contains a working, signed update path, with rollback.Why the update channel belongs in the first firmware.
  9. Every message carries the firmware version and a timestamp. During every roll-out, firmware 1.0 and 1.3 write into the same table. With the version in the envelope, the backend knows how to read each message.
  10. One device can be revoked alone, and every identity, firmware version and update is recorded from the first device. RED applies since August 2025, CRA reporting since September 2026. What RED and the CRA ask, and which records you need.

What changes from 10 to 1,000 to 5,000 devices?

The rules stay the same, but the evidence that they work gets stricter. Pass a gate when its risks are closed, whatever the device count is at that moment:

GateBefore 50 (pilot)Before 500 (first series)Before 5,000 (scale)
IdentityOne certificate per deviceFactory or first-boot enrolmentRe-enrolment of expired devices tested
KeysDevice keys not in plain flashSecure Boot and flash encryption in productionCA and signing keys in an HSM, use approved and logged
UpdatesSigned OTA with rollbackTarget versions per groupStaged releases, anti-rollback
Data pathBatched writes, devices off the app’s limitsBuffer with back-pressureBurst test at twice the fleet
MonitoringLast seen, firmware versionCertificate expiry, handshake failuresGaps, buffer depth, alerts with someone on call
ProcessA log of field issuesVulnerability intake, support period definedIncident workflow, CRA records

How do I give these rules to my coding agent?

Give the rules to your agent where it reads before it writes code. That is a short section in AGENTS.md or CLAUDE.md of the firmware repository, the project instructions of your agent client, or yngest.com/llms.txt, which starts with this checklist. Every article of the series also carries its rule right under the summary in its markdown version. A section to paste into AGENTS.md:

## Device rules (apply from the first firmware)1. Own identity per device, private key generated on the device. No shared secrets in firmware.2. Certificates renew automatically inside a window, with a recovery path.3. Enable certificate date checks (CONFIG_MBEDTLS_HAVE_TIME_DATE) and sync time (SNTP) before the first TLS connection.4. Trust a long-lived private root we control, never a public server certificate.5. Devices never connect to the application database. Use a buffer in between.6. Reconnect with exponential backoff and jitter.7. Apps read and write device state through a twin, never directly to the device.8. Ship a working, signed update path with rollback.9. Put firmware version and timestamp into every message.10. One device can be revoked alone; record identities, firmware versions and updates.

Sources

Frequently asked questions

Do I need all ten rules for a prototype?

A lab demo that never leaves the building can skip most of them. As soon as devices go to a customer or into the field, the first firmware is the one that stays, so the rules apply from the first device that leaves your desk.

Which rule is the most expensive to add later?

The update channel, rule 8, because every other fix needs it. Close behind is per-device identity, rule 1: replacing a shared secret touches every device and the backend at the same time, while the old secret keeps working on devices that have not updated.

Can my agent build all of this itself?

It can write most of the code. The hard part is operating it for the lifetime of the devices. That means protecting CA and signing keys, renewing certificates for years, keeping the update server and the records running, and owning all of it after the agent session is closed.

How do I check an existing fleet against the list?

Go through the ten rules with one question each: can a device do this today without a cable? Every no is a firmware change. Order them by what the update channel needs first: identity, time, trust and renewal, then the rest.