> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endorlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Endor Labs Agent Kit Cursor SDK

> Run Endor Labs Agent Kit workflows programmatically with the Cursor Python SDK.

The Cursor SDK package runs Endor Labs Agent Kit workflows through Cursor's Python SDK. Use it for automation, CI, backend services, orchestration, and scripted local or cloud runs. To install interactive agents into the Cursor IDE instead, use the [Cursor plugin](/secure-ai-coding/agent-kit/cursor).

The SDK package ships in the public distribution repository, [endorlabs/ai-plugins](https://github.com/endorlabs/ai-plugins), under [`cursor-sdk/`](https://github.com/endorlabs/ai-plugins/tree/main/cursor-sdk). Clone the repository and run the commands below from its root. It includes a `run_cursor_agent.py` launcher, an `agent_definitions.json` agent map, generated prompt files, and a `requirements.txt`.

<Steps>
  <Step title="Install the dependency">
    Install the Cursor Python SDK dependency.

    ```bash theme={null}
    python3 -m pip install -r cursor-sdk/requirements.txt
    ```

    If you use `uv`, run `uv pip install -r requirements.txt` from the `cursor-sdk` directory instead.
  </Step>

  <Step title="Set your API key">
    Export your Cursor API key. Never paste it into a prompt.

    ```bash theme={null}
    export CURSOR_API_KEY="crsr_..."
    ```
  </Step>

  <Step title="Run an agent">
    Run a read-only agent against a local workspace.

    ```bash theme={null}
    python cursor-sdk/run_cursor_agent.py endor-probe-droid-agent \
      --workspace /path/to/repo \
      "Explain what evidence you need to assess GitHub onboarding gaps. Keep it read-only."
    ```

    To run against a Cursor cloud agent, pass `--mode cloud` with a repository URL and ref.

    ```bash theme={null}
    python cursor-sdk/run_cursor_agent.py endor-sca-remediation-agent \
      --mode cloud \
      --repo-url https://github.com/your-org/your-repo \
      --ref main \
      "Prepare a remediation plan only. Do not edit files or open a PR."
    ```

    Cloud SDK agents appear in Cursor Web or the Cursor agents window under `Filter > Source > SDK`.
  </Step>
</Steps>

## Safety

* Setup is readiness guidance only. It does not run `endorctl scan` or `endorctl host-check`.
* Mutating agents still require separate approval for file edits, branch pushes, PR or MR creation, comments, tickets, and Endor Labs policy writes.
* Never paste Cursor, Endor Labs, source-provider, or package-registry secrets into prompts. Use the `CURSOR_API_KEY` environment variable for the SDK key.

See the [Agent Kit overview](/secure-ai-coding/agent-kit) for the full agent catalog, and the [safety model](/secure-ai-coding/agent-kit/safety-model) for the complete safety contract.
