# What is SGX (Software Guard eXtensions)?

**It is a TEE** (Trusted Execution Environment). **Everything outside the processor chip is not trusted.** In particular, the **BIOS** (Basic Input/Output System), the **SMM** (System Management Mode, ring -2), the **ME** (Intel Management Engine, ring -3), and the **OS** (Operating System, ring 0) **are not trusted**.

**The SGX code and data are put inside a special container** (an SGX enclave). The contents of the enclave are **signed** (they are loaded from an untrusted source…) and **can be attested by an external third party**. The contents of the enclave are **isolated** from the rest of the system. The enclave code runs in **ring** **3** (least privileged mode).&#x20;

All **SGX instructions** are implemented in **microcode** (**potential attack vector**).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://davidjosearaujo.gitbook.io/notes-mcs/secure-execution-environments/intel-software-guard-extensions/what-is-sgx-software-guard-extensions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
