---
name: iblai-connect-palo-alto-cortex
description: "Read and write Palo Alto Networks Cortex XDR data through the Cortex XDR public APIs and expose it to an ibl.ai agent as an MCP tool. Use when the user asks an agent to work with Palo Alto Networks Cortex XDR data, or to set up a Palo Alto Networks Cortex XDR MCP connection on ibl.ai."
metadata:
  kind: guide
---

# Palo Alto Networks Cortex XDR connector for AI agents

> A starting point maintained on ibl.ai at https://ibl.ai/developer/connectors/palo-alto-cortex — not part of the iblai/base repository. Checked against Palo Alto Networks, Inc.'s documentation on October 20, 2026; test it against your own Palo Alto Networks Cortex XDR setup before you rely on it.

Cortex XDR and Cortex XSIAM collect endpoint, network, cloud and identity data, group issues (alerts) into cases (incidents), and let analysts query everything with XQL and run response actions on endpoints.

## Auth & conventions

- **API:** Cortex XDR public APIs (REST (JSON, mostly POST)). Tenant-specific endpoints under /public_api/v1/: case/search and case/update/{id}, issue/search, endpoints/isolate and unisolate, file quarantine and scans, and xql/start_xql_query with get_query_results.
- **Base URL:** https://api-{fqdn}/public_api/v1/{api_name}/{call_name}/
- **Access:** Issued by your administrator. A Cortex admin creates a key under Settings > Configurations > Integrations > API Keys, picks a role and optional scope and expiry, and copies the tenant URL. The key is shown only once.
- **Auth:** Standard API key (Authorization + x-xdr-auth-id); Advanced API key (nonce and timestamp hash). Send the key in the Authorization header and its ID in x-xdr-auth-id. Advanced keys hash the key with a nonce and timestamp to prevent replay; cURL cannot do this, scripts can.
- **Limits:** Cortex runs at most four XQL API queries in parallel; xql/get_quota reports remaining daily quota and queries rejected for concurrency.
- Keep Palo Alto Networks Cortex XDR credentials in environment variables or the ibl.ai credential store. Never print a token in chat and never commit one to a file.
- Destructive or outward-facing calls are marked **Confirm with the user first** — do.

## Reads

- **Cases** — POST /public_api/v1/case/search with filters; read case artifacts, timeline and War Room entries.
- **Issues (alerts)** — POST /public_api/v1/issue/search with filters.
- **Endpoints** — List endpoints and their agent status, tags and policy.
- **XQL queries** — POST xql/start_xql_query, then xql/get_query_results; xql/get_quota shows remaining quota.

## Writes

- **Update a case** — POST /public_api/v1/case/update/{case-id}, e.g. status or assignee.
- **Add a War Room or timeline entry** — POST entries/insert or case/timeline/{case-id}/add_record/.
- **Isolate endpoints** — POST /public_api/v1/endpoints/isolate cuts endpoints off the network; unisolate reverses it. **Confirm with the user first.**
- **Quarantine files** — POST /public_api/v1/endpoints/quarantine moves files into quarantine. **Confirm with the user first.**
- **Block list hashes** — POST /public_api/v1/hash_exceptions/blocklist blocks file hashes. **Confirm with the user first.**

## Expose it to an ibl.ai agent (MCP)

Palo Alto Networks, Inc. publishes an official MCP server, Cortex MCP Server (https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/configure-and-deploy-cortex-xdr/cortex-mcp-server). Register it below as-is, or host your own server that wraps the calls in this skill.

First install the ibl.ai platform skills and connect your organization (writes `IBLAI_ORG`, `IBLAI_USERNAME` and `IBLAI_API_KEY` to `.env`):

```bash
npx skills add iblai/base --all
# then, in your coding agent:
/iblai-api-login
```

Every call below sends `Authorization: Api-Token $IBLAI_API_KEY`.

1. **Register the server** — `POST https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mcp-servers/` with `name`, `url`, `transport` (`sse` | `websocket` | `streamable_http`) and `auth_type` (`none` | `token` | `oauth2`). Capture the returned `id`.
   - For an API key or service credential use `auth_type=token` with `auth_scope=platform` for one key across the organization, or scope it to a single agent for one key per agent.
2. **Create the connection** — `POST https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mcp-server-connections/` with `server`, `scope` (`platform` | `mentor` | `user`), `auth_type`, and either `credentials` + `authorization_scheme` or a `connected_service` id for OAuth. Credentials are masked on read; never send a masked value back.
3. **Enable it on the agent** — `GET https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mentors/{agent_id}/settings/`, add `mcp-tool` to `tool_slugs` and the server id to `mcp_servers`, then `PATCH` the full lists back. They are replaced, not merged.

Full reference: https://ibl.ai/developer/platform/mcp/mcp-connections and the `/iblai-api-agent-mcp` skill.

## Example prompts

- "List open high-severity cases from the last 24 hours with their issue counts"
- "Run XQL for processes that contacted 198.51.100.4 this week"
- "Summarize case 4521's artifacts and timeline for the incident report"
- "Which endpoints have a disconnected agent status right now?"

## Guardrails

- Cases, issues and XQL telemetry reveal an organization's endpoints, users and weaknesses. Use role-scoped, expiring keys and confirm every response action with a person.
- Request the narrowest Palo Alto Networks Cortex XDR scopes or role the task needs, and prefer a read-only credential for agents that only answer questions.
- Return the fields the user asked for, not whole records; do not paste personal data into chat that the user did not request.
- Before any write, show the user exactly what will change and wait for a yes.
- Respect the documented limits above: page through results and back off on rate-limit responses instead of retrying in a loop.

## References

- Make your first Cortex API call: https://cortex-docs.paloaltonetworks.com/xdr-api/make-your-first-api-call
- Response action APIs: https://cortex-docs.paloaltonetworks.com/xdr-api/cortex-platform/response-action
- About the Cortex MCP server: https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/configure-and-deploy-cortex-xdr/cortex-mcp-server
- Cortex MCP Server: https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/configure-and-deploy-cortex-xdr/cortex-mcp-server
- This connector on ibl.ai: https://ibl.ai/developer/connectors/palo-alto-cortex
- ibl.ai MCP server connections: https://ibl.ai/developer/platform/mcp/mcp-connections
