@vercel/detect-agent
Advanced tools
+7
-2
@@ -35,2 +35,3 @@ "use strict"; | ||
| const CODEX = "codex"; | ||
| const ANTIGRAVITY = "antigravity"; | ||
| const AUGMENT_CLI = "augment-cli"; | ||
@@ -46,2 +47,3 @@ const OPENCODE = "opencode"; | ||
| CODEX, | ||
| ANTIGRAVITY, | ||
| AUGMENT_CLI, | ||
@@ -69,5 +71,8 @@ OPENCODE | ||
| } | ||
| if (process.env.CODEX_SANDBOX) { | ||
| if (process.env.CODEX_SANDBOX || process.env.CODEX_CI || process.env.CODEX_THREAD_ID) { | ||
| return { isAgent: true, agent: { name: CODEX } }; | ||
| } | ||
| if (process.env.ANTIGRAVITY_AGENT) { | ||
| return { isAgent: true, agent: { name: ANTIGRAVITY } }; | ||
| } | ||
| if (process.env.AUGMENT_AGENT) { | ||
@@ -88,3 +93,3 @@ return { isAgent: true, agent: { name: AUGMENT_CLI } }; | ||
| return { isAgent: true, agent: { name: DEVIN } }; | ||
| } catch (error) { | ||
| } catch (_error) { | ||
| } | ||
@@ -91,0 +96,0 @@ return { isAgent: false, agent: void 0 }; |
+8
-0
| # @vercel/detect-agent | ||
| ## 1.1.1 | ||
| ### Patch Changes | ||
| - Add Antigravity agent detection via `ANTIGRAVITY_AGENT` environment variable ([#15413](https://github.com/vercel/vercel/pull/15413)) | ||
| - Detect Codex when `CODEX_CI` or `CODEX_THREAD_ID` is present. ([#15412](https://github.com/vercel/vercel/pull/15412)) | ||
| ## 1.1.0 | ||
@@ -4,0 +12,0 @@ |
+3
-1
@@ -8,5 +8,6 @@ declare const CURSOR: "cursor"; | ||
| declare const CODEX: "codex"; | ||
| declare const ANTIGRAVITY: "antigravity"; | ||
| declare const AUGMENT_CLI: "augment-cli"; | ||
| declare const OPENCODE: "opencode"; | ||
| export type KnownAgentNames = typeof CURSOR | typeof CURSOR_CLI | typeof CLAUDE | typeof DEVIN | typeof REPLIT | typeof GEMINI | typeof CODEX | typeof AUGMENT_CLI | typeof OPENCODE; | ||
| export type KnownAgentNames = typeof CURSOR | typeof CURSOR_CLI | typeof CLAUDE | typeof DEVIN | typeof REPLIT | typeof GEMINI | typeof CODEX | typeof ANTIGRAVITY | typeof AUGMENT_CLI | typeof OPENCODE; | ||
| export interface KnownAgentDetails { | ||
@@ -30,2 +31,3 @@ name: KnownAgentNames; | ||
| readonly CODEX: "codex"; | ||
| readonly ANTIGRAVITY: "antigravity"; | ||
| readonly AUGMENT_CLI: "augment-cli"; | ||
@@ -32,0 +34,0 @@ readonly OPENCODE: "opencode"; |
+7
-2
@@ -35,2 +35,3 @@ "use strict"; | ||
| const CODEX = "codex"; | ||
| const ANTIGRAVITY = "antigravity"; | ||
| const AUGMENT_CLI = "augment-cli"; | ||
@@ -46,2 +47,3 @@ const OPENCODE = "opencode"; | ||
| CODEX, | ||
| ANTIGRAVITY, | ||
| AUGMENT_CLI, | ||
@@ -69,5 +71,8 @@ OPENCODE | ||
| } | ||
| if (process.env.CODEX_SANDBOX) { | ||
| if (process.env.CODEX_SANDBOX || process.env.CODEX_CI || process.env.CODEX_THREAD_ID) { | ||
| return { isAgent: true, agent: { name: CODEX } }; | ||
| } | ||
| if (process.env.ANTIGRAVITY_AGENT) { | ||
| return { isAgent: true, agent: { name: ANTIGRAVITY } }; | ||
| } | ||
| if (process.env.AUGMENT_AGENT) { | ||
@@ -88,3 +93,3 @@ return { isAgent: true, agent: { name: AUGMENT_CLI } }; | ||
| return { isAgent: true, agent: { name: DEVIN } }; | ||
| } catch (error) { | ||
| } catch (_error) { | ||
| } | ||
@@ -91,0 +96,0 @@ return { isAgent: false, agent: void 0 }; |
+1
-1
| { | ||
| "name": "@vercel/detect-agent", | ||
| "version": "1.1.0", | ||
| "version": "1.1.1", | ||
| "description": "Detect if code is running in an AI agent or automated development environment", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
+1
-0
@@ -34,2 +34,3 @@ # @vercel/detect-agent | ||
| - **Codex** (OpenAI) | ||
| - **Antigravity** (Google DeepMind) | ||
| - **Replit** (online IDE) | ||
@@ -36,0 +37,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances
23735
3.69%231
5.48%125
0.81%32
23.08%