Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[![Bun](https://img.shields.io/badge/Bun-supported-black.svg)](https://bun.sh/)
[![Browser](https://img.shields.io/badge/browser-supported-brightgreen.svg)]()
[![Cloudflare Workers](https://img.shields.io/badge/Cloudflare-Workers-orange.svg)](https://workers.cloudflare.com/)
![Actra Claude](https://img.shields.io/badge/Actra-Claude%20Policy%20Generator-7c3aed)
[![Vercel Edge](https://img.shields.io/badge/Vercel-Edge-black.svg)](https://vercel.com/)
[![License](https://img.shields.io/github/license/getactra/actra)](https://github.com/getactra/actra/blob/main/LICENSE)

Expand Down Expand Up @@ -53,6 +54,10 @@ Python • JavaScript • CLI

![MCP Demo](doc/mcp-demo.gif)

### An AI agent attempted to call an MCP tool.

Actra evaluated policy and **blocked the unsafe operation before execution**.

## Try in 30 seconds

Run Actra directly in your browser:
Expand All @@ -61,9 +66,36 @@ Run Actra directly in your browser:

No setup required. Uses the real WASM engine.

### An AI agent attempted to call an MCP tool.
---

Actra evaluated policy and **blocked the unsafe operation before execution**.
## Generate Policies with Claude (AI-assisted)

Actra provides a **Claude Skill** to help you generate:

- policy YAML
- schema definitions
- governance rules
- real-world policy patterns

### What it can do

- Convert natural language to Actra policies
- Suggest safe policy patterns
- Generate test sample payload

### Example prompts

```
Generate a policy to block refunds above 5000 for non-admin users
```

```
Create a governance policy that ensures all delete actions require approval
```

### Use the Claude Skill

[Install Claude Skill](https://raw.githubusercontent.com/getactra/actra/main/claude/actra-policy-generator.skill)

---

Expand Down
167 changes: 167 additions & 0 deletions claude/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Actra Claude Skill

Generate **Actra policies, schema, and governance rules** using natural language.

This Claude Skill helps you go from **idea to enforceable policy YAML** in seconds.

---

## What this skill does

The Actra Claude Skill can:

* Generate **policy YAML** from plain English
* Create **schema definitions** for actions, actor and snapshot
* Suggest **safe policy patterns**
* Generate **governance policies**
* Explain **why a rule blocks an action**
* Create **test scenarios**

---

## Why this matters

Actra enforces decisions at runtime.

This skill helps you **write those decisions faster and correctly**.

> Actra enforces policies. Claude helps you create them.

---

## Getting Started

### 1. Download the skill

Download the `actra.skill` file:

```
https://raw.githubusercontent.com/getactra/actra/main/claude/actra-policy-generator.skill
```

---

### 2. Add to Claude

1. Open Claude
2. Go to **Customize**
3. Go to **Skills**
4. Select **+** > **+ Create skill** > **Upload a skill** Upload the downloaded `actra.skill` file
5. Activate the skill

---

### 3. Start prompting

You can now describe policies in natural language.

---

## Example Prompts

### Basic Policy

```
Generate a policy to block refunds above 5000
```

---

### Role-based Control

```
Allow refunds above 5000 only for admin users
```

---

### Governance Policy

```
Create a governance rule that ensures all delete actions require approval
```

---

### Agent Safety

```
Block AI agents from calling tools that modify infrastructure
```

---

### Explain Policy

```
Explain why this policy blocks a refund of 8000
```

---

## Example Output

```yaml
version: 1

rules:
- id: block_large_refund
scope:
action: refund
when:
subject:
domain: action
field: amount
operator: greater_than
value:
literal: 5000
effect: block
```

---

## How to use with Actra

1. Generate policy using Claude Skill
2. Copy the YAML
3. Load into Actra runtime

Example:

```python
policy = Actra.from_strings(schema, policy_yaml)
```

Actra will now enforce the generated policy **before execution**.

---

## Best Practices

* Start simple, then refine policies
* Use governance rules for safety-critical systems
* Always test policies with real scenarios
* Keep policies external to application logic

---

## Contributing

Want to improve the skill?

* Add better prompt templates
* Improve policy generation patterns
* Contribute real-world examples

---

## Related

* Main Repo: https://github.com/getactra/actra
* Docs: https://docs.actra.dev

---

## License

Apache 2.0
Binary file added claude/actra-policy-generator.skill
Binary file not shown.
Loading