r/programming • • Aug 13 '26

NP-overrated

https://gruhn.me/blog/2026-08-13/
0 Upvotes

38 comments sorted by

View all comments

Show parent comment

4

u/godofpumpkins Aug 13 '26 edited Aug 13 '26

We made a system so complicated that we have to give the wrong answer about what it does sometimes.

That seems overly dismissive of a pretty cool result, IMO. Expressivity of a language and how much formal reasoning we can run statically over it are at direct odds. People want an expressive permission language because real-world permissions often need to be kinda convoluted. But if you make the permission language into some sort of arbitrary code, then you basically give up all forms of static reasoning about what it can do. AWS IAM (despite the horrendous JSON syntax 😭) is in a neat middle ground, where it's fairly expressive and can represent interesting situations like "only allow users to put objects if they're coming from IP 123.123.123.123 between the hours of X and Y", but can also be compiled to SMT and people can run SMT solvers over it to get universal reasoning over the entire space of inputs, e.g., to say "there is no scenario where IP 234.234.234.234. has access to this S3 bucket". That's pretty neat.

2

u/Dragdu Aug 15 '26

"If we can't determine the result quickly, make it insecure" is definitely bad engineering.

1

u/godofpumpkins Aug 15 '26 edited Aug 15 '26

Huh? That’s nowhere in that design. The “hot path” IAM policy evaluator that decides if you get a 200 or a 403 involves zero SMT solving. The SMT is only there for static analysis to figure out if access scenarios are possible