# Immunize Fetch Missing Credentials

> Use when writing cross-origin fetch() calls that require cookies or session auth to ensure `credentials: 'include'` is set.

- **Type:** Skill
- **Install:** `agentstack add skill-viditkbhatnagar-immunize-fetch-missing-credentials`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [viditkbhatnagar](https://agentstack.voostack.com/s/viditkbhatnagar)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [viditkbhatnagar](https://github.com/viditkbhatnagar)
- **Source:** https://github.com/viditkbhatnagar/immunize/tree/main/src/immunize/patterns/fetch-missing-credentials
- **Website:** https://pypi.org/project/immunize/

## Install

```sh
agentstack add skill-viditkbhatnagar-immunize-fetch-missing-credentials
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# fetch-missing-credentials

When you call a cross-origin endpoint that requires cookies, session tokens,
or any credentialed auth, include `credentials: 'include'` in the fetch
options. Browsers default to `credentials: 'same-origin'`, which drops
cookies on cross-origin requests — the backend rejects the call with
401/403 and the response fails CORS preflight.

## Example

Wrong — bare fetch to another origin; cookies won't be sent:

```jsx
async function fetchUser() {
  const response = await fetch('https://api.example.com/me');
  return response.json();
}
```

Right — credentials flag forces cookies to travel:

```jsx
async function fetchUser() {
  const response = await fetch('https://api.example.com/me', {
    credentials: 'include',
  });
  return response.json();
}
```

## Server side must match

For `credentials: 'include'` to work, the server must respond with
`Access-Control-Allow-Credentials: true` AND an explicit
`Access-Control-Allow-Origin: ` (never `*`). If either is
missing, the browser blocks the response even though the network call
succeeded.

## When not to use it

Same-origin requests, public endpoints, and requests that rely on a
Bearer token in the `Authorization` header don't need this flag. Adding
it unnecessarily is a minor security footgun — the browser sends cookies
the endpoint doesn't care about.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [viditkbhatnagar](https://github.com/viditkbhatnagar)
- **Source:** [viditkbhatnagar/immunize](https://github.com/viditkbhatnagar/immunize)
- **License:** Apache-2.0
- **Homepage:** https://pypi.org/project/immunize/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-viditkbhatnagar-immunize-fetch-missing-credentials
- Seller: https://agentstack.voostack.com/s/viditkbhatnagar
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
