agentleFS
ScaleDockHQScaleDockHQ/scaledock-skills/skills/cedar/SKILL.md

cedar

Skill1 starsChanged 31 days agoMITView on GitHub

Cedar policy language 4.5: write, validate and evaluate authorization policies with entities, schemas, templates and PARC requests. Use when adding fine-grained authorization to an application, modelling RBAC or ABAC as permit and forbid policies, designing a Cedar schema, writing entity and context JSON, linking policy templates for sharing features, debugging an unexpected Allow or Deny, or reviewing policies for safety. Triggers: Cedar, cedar-policy, Cedar policy, cedarschema, permit, forbid, when, unless, principal action resource context, PARC, policy template, ?principal, ?resource, template-linked policy, entity hierarchy, Cedar validator, default deny, forbid overrides permit, Amazon Verified Permissions.

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write the policies: Start from least privilege, use in for groups and hierarchies, and use forbid for guardrails.

    line 41
  2. Very specific:

    Validate: Run the validator against the schema and fix every error.

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cedar

Cedar is an open-source policy language for authorization, maintained in the cedar-policy project. Policies permit or forbid a principal taking an action on a resource in a context, an authorizer combines them into Allow or Deny, and a validator checks policies against a schema. With this skill the agent writes Cedar policies, schemas and entity data that validate and that decide requests as intended.

Follow the workflow below step by step. Every rule here comes from a source in Sources, with the section it cites. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.

Inputs (fill in, or ask before starting)

  • Role: policy author, application integrating the authorizer, or reviewer.
  • Model: the principals, actions, resources and hierarchies of the application, and which decisions need attributes or context.
  • Revision: Cedar language version 4.5, implemented by SDK versions 4.10.0 to 4.13.0; pinned to SDK v4.13.0 (Released, 2026-09-15).
  • Sources: when refreshing, re-read every URL in Sources, check the document history for a new language version and the releases page for a new SDK, and update the pins.

Invariants

  1. Default deny, forbid overrides permit, skip on error. Any satisfied forbid gives Deny; else any satisfied permit gives Allow; else Deny. A policy whose evaluation errors is ignored (authorization, Algorithm and Discussion).
  2. Every policy has an effect and a full scope. permit or forbid, then principal, action and resource, each unconstrained or constrained with ==, in or is; optional when and unless; a closing ; (policy syntax).
  3. A request is PARC: principal, action and resource are entity references and context is a record (authorization, Request creation).
  4. Entity IDs are unique, immutable and never reused, such as UUIDs, so that a recycled name never inherits old grants (policy syntax; security best practices).
  5. Validate policies against a schema before use. The authorizer does not validate; requests and entities must follow the schema, or a valid policy may error at run time and be skipped (validation, Request validation expectations).
  6. Guard optional attributes and tags with has or .hasTag() before access; access to a missing attribute is an error (operators, has).
  7. Template placeholders are ?principal and ?resource only, on the right of == or in in the scope (templates).
  8. Build dynamic policies from templates, never string concatenation, to prevent Cedar code injection (security best practices).
  9. Annotations do not affect evaluation; @id is not special in the language (policy syntax, Annotations).

Workflow

  1. Model entities and actions. Choose entity types, parent relations and attributes, and the actions with the principal and resource types they apply to. -> references/schema-entities.md ✓ A Cedar schema declares every entity type and action, with appliesTo for each action.
  2. Write the policies. Start from least privilege, use in for groups and hierarchies, and use forbid for guardrails. -> references/policies.md ✓ Each policy has a reason in an annotation and uses only schema names.
  3. Use templates where grants are per user or per resource. Link templates rather than generating policy text. -> references/policies.md ✓ No policy text is built by concatenating input.
  4. Validate. Run the validator against the schema and fix every error; review warnings. -> references/validation-evaluation.md ✓ Validation reports no errors.
  5. Build requests and entity data. Produce PARC requests and entity JSON that follow the schema, with schema-based parsing where available. -> references/schema-entities.md ✓ Test requests cover allow, deny and forbid-override cases, and the expected determining policies.
  6. Integrate and review. Authenticate before authorizing, bound input sizes, log decisions with determining policies and errors, and re-validate on schema change. -> references/validation-evaluation.md ✓ Errors in the response are monitored, not silently dropped.

Verify before done

  • Every policy validates against the schema with no errors.
  • Optional attributes and tags are guarded with has or .hasTag().
  • Entity IDs are UUIDs or other non-reusable IDs, not names.
  • Tests include a request where a forbid overrides a matching permit.
  • Policies created at run time are template-linked, not concatenated.
  • Authorization responses' errors are logged.

Reference index

  • references/policies.md: policy structure, scope forms, conditions, annotations, operators, templates and patterns. Load for steps 2 and 3.
  • references/schema-entities.md: the Cedar schema format, the JSON schema form, entity and context JSON, and requests. Load for steps 1 and 5.
  • references/validation-evaluation.md: the authorization algorithm, policy evaluation, validation checks and their limits, the 4.13.0 warning change, and security practices. Load for steps 4 and 6.

Related skills

  • openfeature when authorization and feature flags share targeting attributes: npx skills add ScaleDockHQ/scaledock-skills --skill openfeature.
  • ocsf to log authorization decisions as audit events: npx skills add ScaleDockHQ/scaledock-skills --skill ocsf.

Sources

Status uses the publishing body's own maturity term. Checked is the date the source was last read.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.