> For the complete documentation index, see [llms.txt](https://nytshift.gitbook.io/nytshift-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nytshift.gitbook.io/nytshift-docs/agents-identity-and-data/operator-session.md).

# Operator session incident

1. Keep `EXECUTION_KILL_SWITCH=true` and stop all new review, submit and cancel actions. Public read-only market/account views may remain available.
2. Check `/api/session` and `/api/execution/status`. Record only state/reason/expiry; never record the cookie, CSRF value, operator secret, signer token or account key.
3. For repeated `AUTHENTICATION_FAILED` or `LOGIN_RATE_LIMITED`, stop attempts until the Retry-After window clears and confirm the request originates from the approved local browser.
4. For unexpected authenticated state, use **Lock operator session**, then stop the supervisor. Rotate `NIGHTSHIFT_OPERATOR_SECRET` in the launching shell and rotate signer/internal secrets if compromise could have crossed that separate boundary.
5. Restart with execution still disabled. Confirm the old cookie is rejected, `/api/execution/status` is redacted while locked, and the new session expires after 15 minutes.
6. For `CSRF_TOKEN_INVALID`, refresh the terminal once to recover same-origin session state. Do not weaken Origin, SameSite, CSP, cookie scope or CSRF checks.
7. Re-enable only the previously approved testnet/canary mode after audit history, open orders, fills and balances reconcile and the kill-switch rehearsal passes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://nytshift.gitbook.io/nytshift-docs/agents-identity-and-data/operator-session.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
