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.
npx agentmods add rules/atlassian/forge-skills/prefer-context-authzgit clone --depth 1 https://github.com/atlassian/forge-skillsWrote 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.
[](https://agentmods.dev/rules/atlassian/forge-skills/prefer-context-authz)<a href="https://agentmods.dev/rules/atlassian/forge-skills/prefer-context-authz"><img src="https://agentmods.dev/badge/rules/atlassian/forge-skills/prefer-context-authz.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01205 | $0.01205 |
| Opus 5 | $0.00602 | $0.00602 |
| Sonnet 5 | $0.00241 | $0.00241 |
| Haiku 4.5 | $0.00120 | $0.00120 |
Grade A, and why
prefer-context-authz 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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context
- This rule uses terms which may have more up-to-date explanations from the Forge MCP server
- Forge functions may be distinguished from other JS functions by:
- Being exported, and furthermore,
- Being named under
modules.functions.[].handler, as the last name in a.-separated chain
- Forge functions receive two arguments: a module-specific payload, and an object containing contextual information for the function invocation. Call the latter one the "context object." See the signature described under "Forge Function Signature"
- There are also forge resolver functions, which appear as the second argument of
foo.define()calls, wherefoois a variable constructed from a@forge/resolverResolverobject. - Forge resolver functions have a signature described under "Resolver Function Signature" in this rule, with a context
object of type
Context, and a payload namedpayload. - The context object is validated in full by the Forge platform. Some apps use an anti-pattern of passing information
avilable in this object (commonly
accountId) explicitly through the payload object instead. Since the latter is not validated, the app must validate it iself, but this may result in incorrect validation or even absent validation, and should be avoided.
Resolver Function Signature
type Context = {
accountId?: string;
accountType?: 'licensed' | 'unlicensed' | 'customer' | 'anonymous';
cloudId?: string;
workspaceId?: string;
localId: string;
installContext: string;
environmentId: string;
environmentType: string;
extension: {
config?: { [key: string]: any } // defined for macro extensions
[key: string]: any;
},
installation?: {
ari: {
installationId: string;
toString: () => string;
},
contexts: [
{
cloudId?: string,
workspaceId?: string,
toString: () => string
}
]
}
};
function define(
functionKey: string,
// IMPORTANT: this parameter receives the resolver dunction definition
cb: (request: {
payload: { [key in number | string]: any;},
context: Context
}) => Promise<{ [key: string]: any } | string | void> | { [key: string]: any } | string | void,
): this
Forge Function Signature
// The type of the context object
export type Context = {
installContext: string;
principal?: Principal;
license?: License;
installation?: Installation;
workspaceId?: string;
}
export type Principal = {
accountId: string;
}
export type License = {
isActive: boolean;
billingPeriod?: string | null;
capabilitySet?: string | null;
ccpEntitlementId?: string | null;
ccpEntitlementSlug?: string | null;
isEvaluation?: boolean | null;
subscriptionEndDate?: string | null;
supportEntitlementNumber?: string | null;
trialEndDate?: string | null;
type?: string | null;
};
export type Installation = {
ari: InstallationAri;
contexts: ContextAri[];
}
export type InstallationAri = {
installationId: string;
toString: () => string;
};
export type ContextAri = {
cloudId?: string;
workspaceId?: string;
toString: () => string;
}
// IMPORTANT: This is the forge function
export const handler = (payload, context: Context) => {
// Does something
}
Scope & Signals
- Manifest location of interest:
modules.functions.[].handler - Any resolver functions defined by
.define()calls on a variable of typeResolver - Risk indicators:
- The payload object contains fields that are identical or likely contain the same information as fields available in the context object. Note that the fields available in this object will depend on whether it is a resolver function or not
Detection Process
1. Extract all forge function `handler` keys from the manifest
2. Extract all `resolver` keys present, at any depth, under the `modules` key in the manifest
3. Treat all functions identified by (1) as forge functions, and all from (2) as resolver functions
4. Find the definition of each function in the source code
5. Check, as thoroughly as you can, how each of these functions use their payload objects. Look for field names or
accesses which are likely to contain information similar to the context fields available for that type of function
a. Pay closer attention to fields which are eventually passed to `asApp()` endpoint calls
6. If any likely such use is found, flag the function for review
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.
- 4d ago First seen · 149 lines · 1,205 tokens per session scan A 1423a7fa4a52
prefer-context-authz is a cursor rule published in the GitHub repository atlassian/forge-skills (20 stars, last pushed 4d ago), licensed Apache-2.0. It adds 1,205 tokens to every session, about $0.0060 per session on Opus 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.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.