Skip to content

Commit 259877d

Browse files
committed
docs: require OpenProse remote import consent
1 parent d8ee630 commit 259877d

6 files changed

Lines changed: 93 additions & 42 deletions

File tree

docs/prose.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ OpenProse registers `/prose` as a user-invocable skill command:
7171
`/prose run <handle/slug>` resolves to `https://p.prose.md/<handle>/<slug>`.
7272
Direct URLs are fetched as-is using the `web_fetch` tool.
7373

74+
Top-level remote runs are explicit. Remote imports inside a `.prose` program are
75+
transitive code dependencies: before OpenProse fetches any remote `use` target,
76+
it shows the resolved import list and requires the operator to reply exactly
77+
`approve remote prose imports` for that run.
78+
7479
## What it can do
7580

7681
- Multi-agent research and synthesis with explicit parallelism.
@@ -167,9 +172,12 @@ User-level persistent agents live at:
167172

168173
## Security
169174

170-
Treat `.prose` files like code. Review them before running. Use OpenClaw tool
171-
allowlists and approval gates to control side effects. For deterministic,
172-
approval-gated workflows, compare with [Lobster](/tools/lobster).
175+
Treat `.prose` files like code. Review them before running, including remote
176+
`use` imports. Top-level `/prose run https://...` requests are explicit, but
177+
transitive remote imports require per-run approval before they are fetched or
178+
executed. Use OpenClaw tool allowlists and approval gates to control side
179+
effects. For deterministic, approval-gated workflows, compare with
180+
[Lobster](/tools/lobster).
173181

174182
## Related
175183

extensions/open-prose/skills/prose/SKILL.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,27 @@ prose run alice/code-review
8989
2. Fetch the `.prose` content
9090
3. Load the VM and execute as normal
9191

92-
This same resolution applies to `use` statements inside `.prose` files:
92+
Top-level remote runs are explicit user requests. Transitive imports inside a
93+
program are different: treat every remote `use` target as a code dependency that
94+
needs operator consent before it is fetched or executed.
95+
96+
This same resolution applies to `use` statements inside `.prose` files, but the
97+
VM must fail closed until the operator approves the remote dependency list:
9398

9499
```prose
95100
use "https://example.com/my-program.prose" # Direct URL
96101
use "alice/research" as research # Registry shorthand
97102
```
98103

104+
When a program contains any remote `use` target (`http://`, `https://`, or
105+
registry shorthand):
106+
107+
1. Collect and display the exact resolved remote targets.
108+
2. Explain that these are transitive code dependencies for this run.
109+
3. Ask the operator to reply exactly `approve remote prose imports` to continue.
110+
4. Do not fetch, parse, register, or execute those imports unless that exact
111+
approval is given in this run.
112+
99113
---
100114

101115
## File Locations

extensions/open-prose/skills/prose/compiler.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -339,21 +339,24 @@ Please provide final recommendations.
339339

340340
## Use Statements (Program Composition)
341341

342-
Use statements import other OpenProse programs from the registry at `p.prose.md`, enabling modular workflows.
342+
Use statements import other OpenProse programs from registry paths or direct
343+
HTTP(S) URLs, enabling modular workflows.
343344

344345
### Syntax
345346

346347
```prose
347348
use "@handle/slug"
348349
use "@handle/slug" as alias
350+
use "https://example.com/program.prose" as alias
349351
```
350352

351353
### Path Format
352354

353-
Import paths follow the format `@handle/slug`:
355+
Import paths are either registry references or direct HTTP(S) URLs:
354356

355-
- `@handle` identifies the program author/organization
356-
- `slug` is the program name
357+
- `@handle/slug` identifies a program author/organization and slug.
358+
- `handle/slug` resolves to the same registry host used by the runtime.
359+
- `https://example.com/program.prose` fetches that exact URL after approval.
357360

358361
An optional alias (`as name`) allows referencing by a shorter name.
359362

@@ -371,26 +374,32 @@ use "@bob/critique" as critic
371374

372375
When the OpenProse VM encounters a `use` statement:
373376

374-
1. Fetch the program from `https://p.prose.md/@handle/slug`
375-
2. Parse the program to extract its contract (inputs/outputs)
376-
3. Register the program in the Import Registry
377+
1. Resolve the import target.
378+
2. If the target is remote (`http://`, `https://`, or registry shorthand), pause
379+
before fetching and require the operator to approve the full remote import
380+
list with `approve remote prose imports` for this run.
381+
3. Fetch the program only after approval.
382+
4. Parse the program to extract its contract (inputs/outputs).
383+
5. Register the program in the Import Registry.
377384

378385
### Validation Rules
379386

380387
| Check | Severity | Message |
381388
| --------------------- | -------- | -------------------------------------- |
382389
| Empty path | Error | Use path cannot be empty |
383-
| Invalid path format | Error | Path must be @handle/slug format |
390+
| Invalid path format | Error | Path must be registry path or URL |
384391
| Duplicate import | Error | Program already imported |
385392
| Missing alias for dup | Error | Alias required when importing multiple |
386393

387394
### Execution Semantics
388395

389396
Use statements are processed before any agent definitions or sessions. The OpenProse VM:
390397

391-
1. Fetches and validates all imported programs at the start of execution
392-
2. Extracts input/output contracts from each program
393-
3. Registers programs in the Import Registry for later invocation
398+
1. Resolves all imported program targets at the start of execution.
399+
2. Requires operator approval before fetching any remote imports.
400+
3. Fetches and validates approved imported programs.
401+
4. Extracts input/output contracts from each program.
402+
5. Registers programs in the Import Registry for later invocation.
394403

395404
---
396405

extensions/open-prose/skills/prose/guidance/system-prompt.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,10 @@ For general programming tasks, please use a general-purpose agent instance.
162162
## Execution Algorithm (Simplified)
163163

164164
1. Parse program structure (use statements, inputs, agents, blocks)
165-
2. Bind inputs from caller or prompt user if missing
166-
3. For each statement in order:
165+
2. Resolve `use` imports. If any import is remote, require the operator to
166+
approve the full list with `approve remote prose imports` before fetching.
167+
3. Bind inputs from caller or prompt user if missing
168+
4. For each statement in order:
167169
- `session` → Task tool call, await result
168170
- `resume` → Load memory, Task tool call, await result
169171
- `let/const` → Execute RHS, bind result
@@ -172,8 +174,8 @@ For general programming tasks, please use a general-purpose agent instance.
172174
- `try/catch` → Execute try, catch on error, always finally
173175
- `choice/if` → Evaluate conditions, execute matching branch
174176
- `do block` → Push frame, bind args, execute body, pop frame
175-
4. Collect output bindings
176-
5. Return outputs to caller
177+
5. Collect output bindings
178+
6. Return outputs to caller
177179

178180
## Remember
179181

extensions/open-prose/skills/prose/prose.md

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ use "https://example.com/my-program.prose" # Direct URL
6363
use "alice/research" as research # Registry shorthand
6464
```
6565

66+
Top-level remote runs are explicit user requests. Remote `use` statements are
67+
transitive code dependencies. Before fetching any remote `use` target, collect
68+
the exact resolved targets, show them to the operator, and require the operator
69+
to reply exactly `approve remote prose imports` for this run. If approval is not
70+
given, abort the run before fetching, parsing, registering, or executing the
71+
remote imports.
72+
6673
---
6774

6875
## Why This Is a VM
@@ -113,18 +120,18 @@ When you execute a `.prose` program, you ARE the virtual machine. This is not a
113120

114121
Traditional dependency injection containers wire up components from configuration. You do the same—but with understanding:
115122

116-
| Declared Primitive | Your Responsibility |
117-
| --------------------------- | ---------------------------------------------------------- |
118-
| `use "handle/slug" as name` | Fetch program from p.prose.md, register in Import Registry |
119-
| `input topic: "..."` | Bind value from caller, make available as variable |
120-
| `output findings = ...` | Mark value as output, return to caller on completion |
121-
| `agent researcher:` | Register this agent template for later use |
122-
| `session: researcher` | Resolve the agent, merge properties, spawn the session |
123-
| `resume: captain` | Load agent memory, spawn session with memory context |
124-
| `context: { a, b }` | Wire the outputs of `a` and `b` into this session's input |
125-
| `parallel:` branches | Coordinate concurrent execution, collect results |
126-
| `block review(topic):` | Store this reusable component, invoke when called |
127-
| `name(input: value)` | Invoke imported program with inputs, receive outputs |
123+
| Declared Primitive | Your Responsibility |
124+
| --------------------------- | ----------------------------------------------------------------------- |
125+
| `use "handle/slug" as name` | Resolve import, require approval if remote, register in Import Registry |
126+
| `input topic: "..."` | Bind value from caller, make available as variable |
127+
| `output findings = ...` | Mark value as output, return to caller on completion |
128+
| `agent researcher:` | Register this agent template for later use |
129+
| `session: researcher` | Resolve the agent, merge properties, spawn the session |
130+
| `resume: captain` | Load agent memory, spawn session with memory context |
131+
| `context: { a, b }` | Wire the outputs of `a` and `b` into this session's input |
132+
| `parallel:` branches | Coordinate concurrent execution, collect results |
133+
| `block review(topic):` | Store this reusable component, invoke when called |
134+
| `name(input: value)` | Invoke imported program with inputs, receive outputs |
128135

129136
You are the container that holds these declarations and wires them together at runtime. The program declares _what_; you determine _how_ to connect them.
130137

@@ -698,7 +705,9 @@ Query the database to access the content.
698705

699706
## Program Composition
700707

701-
Programs can import and invoke other programs, enabling modular workflows. Programs are fetched from the registry at `p.prose.md`.
708+
Programs can import and invoke other programs, enabling modular workflows.
709+
Registry and direct-URL imports are remote code dependencies and require
710+
operator approval before fetching.
702711

703712
### Importing Programs
704713

@@ -709,15 +718,20 @@ use "alice/research"
709718
use "bob/critique" as critic
710719
```
711720

712-
The import path follows the format `handle/slug`. An optional alias (`as name`) allows referencing by a shorter name.
721+
The import path can be a registry reference (`handle/slug`) or a direct HTTP(S)
722+
URL. An optional alias (`as name`) allows referencing by a shorter name.
713723

714724
### Program URL Resolution
715725

716726
When the VM encounters a `use` statement:
717727

718-
1. Fetch the program from `https://p.prose.md/handle/slug`
719-
2. Parse the program to extract its contract (inputs/outputs)
720-
3. Register the program in the Import Registry
728+
1. Resolve the import target.
729+
2. If the target is remote (`http://`, `https://`, or registry shorthand), pause
730+
before fetching and require the operator to approve the full remote import
731+
list with `approve remote prose imports` for this run.
732+
3. Fetch the program only after approval.
733+
4. Parse the program to extract its contract (inputs/outputs).
734+
5. Register the program in the Import Registry.
721735

722736
### Input Declarations
723737

@@ -1156,11 +1170,13 @@ Before spawning, substitute `{varname}` with variable values.
11561170

11571171
```
11581172
function execute(program, inputs?):
1159-
1. Collect all use statements, fetch and register imports
1160-
2. Collect all input declarations, bind values from caller
1161-
3. Collect all agent definitions
1162-
4. Collect all block definitions
1163-
5. For each statement in order:
1173+
1. Collect all use statements, resolve import targets
1174+
2. If remote imports are present, require operator approval before fetch
1175+
3. Fetch approved imports and register them
1176+
4. Collect all input declarations, bind values from caller
1177+
5. Collect all agent definitions
1178+
6. Collect all block definitions
1179+
7. For each statement in order:
11641180
- If session: spawn via Task, await result
11651181
- If resume: load memory, spawn via Task, await result
11661182
- If let/const: execute RHS, bind result
@@ -1219,7 +1235,7 @@ When passing context to sessions:
12191235

12201236
The OpenProse VM:
12211237

1222-
1. **Imports** programs from `p.prose.md` via `use` statements
1238+
1. **Imports** approved programs via `use` statements
12231239
2. **Binds** inputs from caller to program variables
12241240
3. **Parses** the program structure
12251241
4. **Collects** definitions (agents, blocks)

extensions/open-prose/skills/prose/state/in-context.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ For variable resolution across scopes:
210210

211211
```
212212
[Import] Importing: @alice/research
213+
Remote dependency requires approval: https://p.prose.md/@alice/research
214+
Operator approved: approve remote prose imports
213215
Fetching from: https://p.prose.md/@alice/research
214216
Inputs expected: [topic, depth]
215217
Outputs provided: [findings, sources]

0 commit comments

Comments
 (0)