@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 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 grants, 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.
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
 
@@ -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 keep infra failures fail-open,
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
- * logs a warning to stderr and allows (exit 0), well inside Amp's window.
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
- * Fail-open: any error — parse failure, network error, rate limit, crash —
26
- * resolves to exit 0 (allow). The delegate must never wedge the agent.
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).
@@ -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 keep infra failures fail-open,
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
- * logs a warning to stderr and allows (exit 0), well inside Amp's window.
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
- * Fail-open: any error — parse failure, network error, rate limit, crash —
27
- * resolves to exit 0 (allow). The delegate must never wedge the agent.
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 allow (fail-open for infra failures). The
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 that turns a hanging backend into an allow.
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; allowing (fail-open)\n`);
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.ALLOW };
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.5.3",
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.5.3"
73
+ "@ory/argus": "1.7.0"
74
74
  },
75
75
  "devDependencies": {
76
- "typescript": "^6.0.2"
76
+ "typescript": "^7.0.2"
77
77
  },
78
78
  "engines": {
79
79
  "node": ">=22"