global-state-warmstart

global-state-warmstart is a cursor rule for Cursor from atlassian/forge-skills. It costs 15 tokens per session (1,455 once invoked), scanned A, original, Apache-2.0.

Code-review rules for Forge RuntimeV2 applications running on AWS Lambda, a service that runs code on demand. They focus on global variables and cached data surviving between requests from different customers.

In plain words
What is it for?
Use it to review handlers, caches, configuration, and other module-level state for possible cross-customer data leaks.
Why use it?
AWS Lambda can reuse a running process, so data left in shared memory may be exposed to another customer. These rules help identify that tenant-isolation risk.

Cursor rule for Cursor ✓ vendor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it to review handlers, caches, configuration, and other module-level state for possible cross-customer data leaks.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/atlassian/forge-skills/global-state-warmstart
About the project

Atlassian Forge Skills supports Atlassian Forge, a platform for building and deploying apps that extend products such as Jira and Confluence. Its skills and MCP-backed tools help coding agents create Forge apps, review them before deployment, optimize usage, troubleshoot failures, and work with Forge APIs and the Atlassian Design System.

atlassian/forge-skills · 35 stars · on GitHub · developer.atlassian.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/atlassian/forge-skills

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for global-state-warmstart

README.md
[![agentmods](https://agentmods.dev/badge/rules/atlassian/forge-skills/global-state-warmstart/github.svg)](https://agentmods.dev/rules/atlassian/forge-skills/global-state-warmstart)
Your own site
<a href="https://agentmods.dev/rules/atlassian/forge-skills/global-state-warmstart"><img src="https://agentmods.dev/badge/rules/atlassian/forge-skills/global-state-warmstart/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for global-state-warmstart

Your own site · 80×15
<a href="https://agentmods.dev/rules/atlassian/forge-skills/global-state-warmstart"><img src="https://agentmods.dev/badge/rules/atlassian/forge-skills/global-state-warmstart.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,455 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00015 $0.01455
Opus 5.5 $0.00006 $0.00582
Sonnet 5.5 $0.00003 $0.00291
Haiku 4.5 $0.00002 $0.00145

Measured 20d ago against content hash 1d35a4f7a60f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

global-state-warmstart scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/forge-security-review/assets/security-rules/forge-tenant-isolation/global-state-warmstart.mdc · 191 lines

How it starts

The opening of the file, as written. The whole thing — 191 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context

  • Forge RuntimeV2 uses AWS Lambda which reuses runtime instances (warm starts). Module-level variables and global state persist across invocations, potentially from different tenants.
  • Related CWE: CWE-668 (Exposure of Resource to Wrong Sphere), CWE-1189 (Improper Isolation of Shared Resources).
  • Critical for multi-tenant Marketplace apps.

RuntimeV2 Behavior

┌─────────────────────────────────────┐
│           Lambda Container          │
│  ┌─────────────────────────────────┐ │
│  │        Warm Start Reuse         │ │
│  │  ┌─────────────────────────────┐ │ │
│  │  │  Invocation 1 (Tenant A)    │ │ │
│  │  │  Sets: globalCache.data     │ │ │
│  │  └─────────────────────────────┘ │ │
│  │              ↓                   │ │
│  │  ┌─────────────────────────────┐ │ │
│  │  │  Invocation 2 (Tenant B)    │ │ │
│  │  │  Reads: globalCache.data    │ │ │ ← TENANT LEAK!
│  │  └─────────────────────────────┘ │ │
│  └─────────────────────────────────┘ │
└─────────────────────────────────────┘

Scope & Signals

  • Dangerous patterns:
    • Module-level variables outside handler functions.
    • Caches without tenant-scoped keys.
    • Global configuration objects modified at runtime.
    • Feature flag caches shared across tenants.
  • Sources: Any tenant-specific data (user info, configurations, API responses).
  • Risk: Data from Tenant A accessible to Tenant B on subsequent invocations.

Vulnerable Patterns

// VULNERABLE - Module-level cache without tenant scoping
const issueCache = {};  // Persists across Lambda invocations!

export async function handler(payload, context) {
  const issueId = payload.issueId;
  
  if (!issueCache[issueId]) {
    issueCache[issueId] = await fetchIssue(issueId);
  }
  
  return issueCache[issueId];  // May return data from another tenant
}

// VULNERABLE - Global configuration
let appConfig = null;

export async function getConfig(context) {
  if (!appConfig) {
    appConfig = await storage.get('config');  // Tenant A's config
  }
  return appConfig;  // Tenant B gets Tenant A's config!
}

// VULNERABLE - Feature flags
const featureFlags = {};

export async function isFeatureEnabled(feature, context) {
  if (!featureFlags[feature]) {
    featureFlags[feature] = await checkFeature(feature);
  }
  return featureFlags[feature];
}

// VULNERABLE - User session/state
let currentUser = null;

export async function getCurrentUser(context) {
  if (!currentUser) {
    currentUser = await fetchUser(context.accountId);
  }
  return currentUser;  // Wrong user for subsequent invocations!
}

Secure Patterns

// SECURE - Tenant-scoped cache keys
const cache = new Map();

function getCacheKey(tenantId, resourceId) {
  return `${tenantId}:${resourceId}`;
}

export async function handler(payload, context) {
  const tenantId = context.installContext.cloudId;
  const cacheKey = getCacheKey(tenantId, payload.issueId);
  
  if (!cache.has(cacheKey)) {
    cache.set(cacheKey, await fetchIssue(payload.issueId));
  }
  
  return cache.get(cacheKey);
}

// SECURE - Fresh state per invocation
export async function handler(payload, context) {
  // Create fresh state for each invocation
  const state = {
    config: null,
    user: null
  };
  
  state.config = await storage.get('config');
  state.user = await fetchUser(context.accountId);
  
  return processRequest(payload, state);
}

// SECURE - Clear cache at invocation start
export async function handler(payload, context) {
  // Reset relevant state
  resetTenantState();
  
  // Process with fresh context
  return await processRequest(payload, context);
}

function resetTenantState() {
  issueCache.clear();
  configCache.clear();
  userCache.clear();
}

// SECURE - Use WeakMap with tenant context as key
const tenantCaches = new WeakMap();

export async function getCache(context) {
  const tenantKey = { id: context.installContext.cloudId };
  if (!tenantCaches.has(tenantKey)) {
    tenantCaches.set(tenantKey, new Map());
  }
  return tenantCaches.get(tenantKey);
}

Read the full file on GitHub · 191 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago Changed · +6 lines 1d35a4f7a60f
  2. 3mo ago First seen · 185 lines · 15 tokens per session scan A 468fa37e44e6

Subscribe to this mod's changes

global-state-warmstart is a cursor rule published in the GitHub repository atlassian/forge-skills (35 stars, last pushed 4d ago), licensed Apache-2.0. It adds 15 tokens to every session and 1,455 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

global-state-warmstart compared with cursor rules from other repositories

global-state-warmstart next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
global-state-warmstartatlassian/forge-skillsCursor rule354d agoApache-2.0A15Cursor
ponytailDietrichGebert/ponytailCursor rule201k8d agoMITA604Cursor
angular-20angular/angularCursor rule102k4d agoMITA0Cursor
dev-standardapache/supersetCursor rule76ktodayApache-2.0A1,147Cursor
prefer-assertions-over-defensive-checksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
prefer-direct-imports-over-module-mocksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
shared-plane-packagesprisma/ormCursor rule48ktodayApache-2.0A0Cursor