# SES SES is *hardened JavaScript*. SES stands for *fearless cooperation*. This package is a SES [shim][define shim] for JavaScript features [proposed][SES proposal] to ECMA TC39. Hardened JavaScript is highly compatible with ordinary JavaScript. Most existing JavaScript libraries can run on hardened JavaScript. * **Compartments** Compartments are separate execution contexts: each one has its own global object and global lexical scope. * **Frozen realm** Compartments share their intrinsics to avoid identity discontinuity. By freezing the intrinsics, SES protects programs from each other. By sharing the intrinsics, programs from separate compartments can recognize each other's arrays, data objects, and so on. * **Strict mode** SES enforces JavaScript strict mode that enhances security, for example by changing some silent failures into thrown errors. * **POLA** (Principle of Least Authority) By default, Compartments receive no ambient authority. They are created without host-provided APIs, (for example no `fetch`). Compartments can be selectively endowed with powerful arguments, globals, or modules. SES safely executes third-party JavaScript 'strict' mode programs in compartments that have no excess authority in their global scope. SES runs atop an ES6-compliant platform, enabling safe interaction of mutually-suspicious code, using object-capability -style programming. See https://github.com/Agoric/Jessie to see how SES fits into the various flavors of confined JavaScript execution. And visit https://ses-demo.agoric.app/demos/ for a demo. SES starts where the Caja project left off https://github.com/google/caja/wiki/SES, and goes on to introduce compartments and modernize the permitted JavaScript features. Please join the conversation on our [Mailing List][SES Strategy Group] and [Matrix][Endo Matrix]. We record a [weekly conference call][SES Strategy Recordings] with the Hardened JavaScript engineering community. _Hardened JavaScript_, Kris Kowal: [![Primer on Hardened JavaScript](https://img.youtube.com/vi/RZ7bBIU8DRc/0.jpg)](https://www.youtube.com/watch?v=RZ7bBIU8DRc) _Don't add Security, Remove Insecurity_, Mark Miller: [![Don't add Security, Remove Insecurity](https://img.youtube.com/vi/u-XETUbxNUU/0.jpg)](https://www.youtube.com/watch?v=u-XETUbxNUU) ## Install ```sh npm install ses ``` ## Usage The SES shim runs in most engines, either as an ESM module `ses` or as a `