@ory/amp 1.5.3 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/permission.d.ts +5 -4
- package/dist/permission.js +12 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -107,6 +107,8 @@ Amp gives the gate 10 seconds to answer and treats a slower gate as a reject, so
|
|
|
107
107
|
|
|
108
108
|
The Ory skills land under `<project>/.agents/skills/`. `uninstall` removes the gate, the plugin, and the skills.
|
|
109
109
|
|
|
110
|
+
**MCP servers.** Amp documents MCP tool names as `mcp__<server>__<tool>` ([Plugin API](https://ampcode.com/docs/plugin-api)). The plugin's `tool.call` handler checks a call with that name as `McpServer:<server>` and `McpTool:<server>:<tool>`, and the gate applies the same check when Amp's (undocumented) delegate payload carries that name; Agent Security resolves the reported server name to a cataloged server, and other tools keep the native check. By default, though, Amp does not send MCP tools to the model one by one: agents reach MCP servers through `code_exec` (with `tool_search`), and those calls arrive as a single `code_exec` tool call that names no server, so they are checked as the native `code_exec` tool. Only MCP tools an agent exposes directly carry the `mcp__` name. No fingerprints are sent, because Amp's payload does not say how a server is launched.
|
|
111
|
+
|
|
110
112
|
</details>
|
|
111
113
|
|
|
112
114
|
## Connect to Ory Agent Security
|
|
@@ -129,7 +131,7 @@ npx -y -p @ory/amp ory-amp configure \
|
|
|
129
131
|
|
|
130
132
|
**Ory Network or OEL.** Either works. For an Ory Network project the URL is `https://<slug>.projects.oryapis.com`; for a self-hosted **Ory Enterprise License** deployment, point `--project-url` at that deployment's base URL and use the sign-in client id from its Agent Security configuration. Everything downstream — sign-in, checks, delegation — is identical.
|
|
131
133
|
|
|
132
|
-
**There is nothing else for you to create.** The sign-in client, permission model, native-tool blocks, MCP
|
|
134
|
+
**There is nothing else for you to create.** The sign-in client, permission model, native-tool blocks, MCP server access, and observe/enforce posture are provisioned in the Console by someone with project access. At session start the plugin loads or enrolls Amp's Talos runtime credential in the OS credential store; tool paths only read it. Installing needs no workspace privilege.
|
|
133
135
|
|
|
134
136
|
Sign-in runs at the start of every session and never blocks — a declined, skipped, or timed-out login simply leaves that session without a user identity.
|
|
135
137
|
|
package/dist/permission.d.ts
CHANGED
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
*
|
|
18
18
|
* TIMEOUT: Amp enforces a 10-second delegate timeout. A delegate that does
|
|
19
19
|
* not exit within 10s is treated as a reject, so a hanging Ory backend
|
|
20
|
-
* would otherwise surface as a block. To
|
|
20
|
+
* would otherwise surface as a block. To return a clear reason,
|
|
21
21
|
* the permission check below is raced against a local deadline (default
|
|
22
22
|
* 5000ms, override via ORY_AMP_CHECK_TIMEOUT_MS); on timeout the delegate
|
|
23
|
-
*
|
|
23
|
+
* rejects with a reason, well inside Amp's window. At that point the gate may
|
|
24
|
+
* not have resolved the applicable posture, so it conservatively blocks.
|
|
24
25
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
26
|
+
* Parse and unexpected delegate errors remain best-effort. Classified permission
|
|
27
|
+
* failures are handled by the shared gate and deny in enforce mode.
|
|
27
28
|
*
|
|
28
29
|
* Verified against the installed `amp` binary (delegate exit-code contract
|
|
29
30
|
* and 10s timeout).
|
package/dist/permission.js
CHANGED
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
*
|
|
19
19
|
* TIMEOUT: Amp enforces a 10-second delegate timeout. A delegate that does
|
|
20
20
|
* not exit within 10s is treated as a reject, so a hanging Ory backend
|
|
21
|
-
* would otherwise surface as a block. To
|
|
21
|
+
* would otherwise surface as a block. To return a clear reason,
|
|
22
22
|
* the permission check below is raced against a local deadline (default
|
|
23
23
|
* 5000ms, override via ORY_AMP_CHECK_TIMEOUT_MS); on timeout the delegate
|
|
24
|
-
*
|
|
24
|
+
* rejects with a reason, well inside Amp's window. At that point the gate may
|
|
25
|
+
* not have resolved the applicable posture, so it conservatively blocks.
|
|
25
26
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
27
|
+
* Parse and unexpected delegate errors remain best-effort. Classified permission
|
|
28
|
+
* failures are handled by the shared gate and deny in enforce mode.
|
|
28
29
|
*
|
|
29
30
|
* Verified against the installed `amp` binary (delegate exit-code contract
|
|
30
31
|
* and 10s timeout).
|
|
@@ -39,7 +40,7 @@ const types_js_1 = require("./types.js");
|
|
|
39
40
|
/**
|
|
40
41
|
* Local deadline for the Ory permission check. Amp treats a delegate that
|
|
41
42
|
* does not exit within 10s as a REJECT, so a hanging backend must be cut
|
|
42
|
-
* off locally and resolved as
|
|
43
|
+
* off locally and resolved as a denial when posture is unknown. The
|
|
43
44
|
* default leaves ample headroom inside Amp's 10s window.
|
|
44
45
|
*/
|
|
45
46
|
const DEFAULT_CHECK_TIMEOUT_MS = 5000;
|
|
@@ -105,7 +106,7 @@ async function decideToolPermission(input, client) {
|
|
|
105
106
|
client.logger.info("delegate.received", { toolName, sessionId });
|
|
106
107
|
try {
|
|
107
108
|
// Amp rejects delegates that exceed ten seconds, so retain a shorter
|
|
108
|
-
// local deadline
|
|
109
|
+
// local deadline so a hanging backend produces an explicit decision.
|
|
109
110
|
const timeoutMs = resolveCheckTimeoutMs();
|
|
110
111
|
const raced = await raceCheckDeadline((0, argus_1.gate)(client, {
|
|
111
112
|
harness: "amp",
|
|
@@ -113,11 +114,14 @@ async function decideToolPermission(input, client) {
|
|
|
113
114
|
toolArgs: input.input ?? input.params ?? input.arguments ?? input.args,
|
|
114
115
|
subjectFallback: sessionId ? `session:${sessionId}` : undefined,
|
|
115
116
|
canBlock: true,
|
|
117
|
+
// Amp names MCP tools `mcp__<server>__<tool>` (ampcode.com/docs/plugin-api).
|
|
118
|
+
// MCP calls an agent makes inside `code_exec` arrive as `code_exec`.
|
|
119
|
+
mcpTool: (0, argus_1.parseMcpToolName)(toolName) ?? undefined,
|
|
116
120
|
}), timeoutMs);
|
|
117
121
|
if (raced === CHECK_TIMED_OUT) {
|
|
118
|
-
process.stderr.write(`[ory-agent] permission check for "${toolName}" timed out after ${timeoutMs}ms;
|
|
122
|
+
process.stderr.write(`[ory-agent] permission check for "${toolName}" timed out after ${timeoutMs}ms; blocking because posture is unknown\n`);
|
|
119
123
|
client.logger.warn("delegate.check_timeout", { toolName, timeoutMs });
|
|
120
|
-
return { exitCode: types_js_1.AMP_DELEGATE_EXIT.
|
|
124
|
+
return { exitCode: types_js_1.AMP_DELEGATE_EXIT.REJECT, reason: "Ory permission check timed out; retry when Agent Security is available." };
|
|
121
125
|
}
|
|
122
126
|
return raced.blocked
|
|
123
127
|
? {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ory/amp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Ory plugin for Amp (Sourcegraph's coding agent): a permission delegate that authorizes every tool call plus an in-process plugin for session auth and activity auditing",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://ory.com",
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
],
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"reova": "^0.7.0",
|
|
73
|
-
"@ory/argus": "1.
|
|
73
|
+
"@ory/argus": "1.7.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"typescript": "^
|
|
76
|
+
"typescript": "^7.0.2"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": ">=22"
|