A proof is only as good as the question it answers.
To prove software secure, someone first has to write down what "secure" means for it. That document is called a specification.
Today a person or an AI model writes it, and nobody can guarantee it says what was intended. Get the spec wrong and the proof proves the wrong thing.
/* requires: input is a string */ /* requires: ??? */ char name[16]; memcpy(name, input, n);
The line nobody wrote down: input fits in 16 bytes. That gap is a buffer overflow.
Forma does not ask anyone to write it.
Forma analyses the code itself. For every single operation, it derives the rules that operation must never break: never read past the end of a buffer, never use memory after it is freed, never overflow.
The same code always gives the same rules. No person and no model is involved in that step.
-
char name[16];is alive while it is used -
size_t n = strlen(input);input ends with a zero byte -
memcpy(name, input, n);n fits in nameinput has n bytes to read -
name[n] = '\0';stays inside name
same code in=same rules outevery time
Then it proves your code follows them.
Not for the inputs someone thought to test. For every input.
Each proof is verified by a small, independent checker, so nothing has to be taken on trust. And when Forma cannot settle a rule, it says so instead of calling it a pass.
- ✓ proved name: is alive while it is used
- ✓ proved memcpy: input has n bytes to read
- ✕ counterexample memcpy: n fits in name
- ✕ counterexample name[n]: stays inside name
- ? unknown strlen: input ends with a zero byte
Where a proof fails, you get the exploit and the fix.
AI agents pick up every rule that could not be proved and look for an input that really breaks the program. When they find one, you get the input, a written report and a suggested patch.
A finding counts only if it crashes the real program at the exact spot the failed proof pointed to.
src/greet.cThe proof of
memcpy: n fits in namefailed. An agent found an input that breaks it, replayed on the built binary:input "AAAAAAAAAAAAAAAAA" (17 letters) result stack buffer overflow, write of 17 bytes into 16 greet src/greet.c:3Suggested change:
+ if (n >= sizeof name) return -1; memcpy(name, input, n);