🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@vercel/detect-agent

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/detect-agent - npm Package Compare versions

Comparing version
1.2.0
to
1.2.1
+13
-1
./dist/index.js

@@ -39,2 +39,4 @@ "use strict";

const OPENCODE = "opencode";
const GITHUB_COPILOT = "github-copilot";
const GITHUB_COPILOT_CLI = "github-copilot-cli";
const KNOWN_AGENTS = {

@@ -51,3 +53,4 @@ CURSOR,

AUGMENT_CLI,
OPENCODE
OPENCODE,
GITHUB_COPILOT
};

@@ -58,2 +61,8 @@ async function determineAgent() {

if (name) {
if (name === GITHUB_COPILOT || name === GITHUB_COPILOT_CLI) {
return {
isAgent: true,
agent: { name: GITHUB_COPILOT }
};
}
return {

@@ -95,2 +104,5 @@ isAgent: true,

}
if (process.env.COPILOT_MODEL || process.env.COPILOT_ALLOW_ALL || process.env.COPILOT_GITHUB_TOKEN) {
return { isAgent: true, agent: { name: GITHUB_COPILOT } };
}
try {

@@ -97,0 +109,0 @@ await (0, import_promises.access)(DEVIN_LOCAL_PATH, import_node_fs.constants.F_OK);

# @vercel/detect-agent
## 1.2.1
### Patch Changes
- Add GitHub Copilot detection support by recognizing `AI_AGENT=github-copilot|github-copilot-cli` and fallback Copilot CLI environment variables (`COPILOT_MODEL`, `COPILOT_ALLOW_ALL`, and `COPILOT_GITHUB_TOKEN`). ([#15449](https://github.com/vercel/vercel/pull/15449))
## 1.2.0

@@ -4,0 +10,0 @@

+3
-1

@@ -12,3 +12,4 @@ declare const CURSOR: "cursor";

declare const OPENCODE: "opencode";
export type KnownAgentNames = typeof CURSOR | typeof CURSOR_CLI | typeof CLAUDE | typeof COWORK | typeof DEVIN | typeof REPLIT | typeof GEMINI | typeof CODEX | typeof ANTIGRAVITY | typeof AUGMENT_CLI | typeof OPENCODE;
declare const GITHUB_COPILOT: "github-copilot";
export type KnownAgentNames = typeof CURSOR | typeof CURSOR_CLI | typeof CLAUDE | typeof COWORK | typeof DEVIN | typeof REPLIT | typeof GEMINI | typeof CODEX | typeof ANTIGRAVITY | typeof AUGMENT_CLI | typeof OPENCODE | typeof GITHUB_COPILOT;
export interface KnownAgentDetails {

@@ -36,4 +37,5 @@ name: KnownAgentNames;

readonly OPENCODE: "opencode";
readonly GITHUB_COPILOT: "github-copilot";
};
export declare function determineAgent(): Promise<AgentResult>;
export {};

@@ -39,2 +39,4 @@ "use strict";

const OPENCODE = "opencode";
const GITHUB_COPILOT = "github-copilot";
const GITHUB_COPILOT_CLI = "github-copilot-cli";
const KNOWN_AGENTS = {

@@ -51,3 +53,4 @@ CURSOR,

AUGMENT_CLI,
OPENCODE
OPENCODE,
GITHUB_COPILOT
};

@@ -58,2 +61,8 @@ async function determineAgent() {

if (name) {
if (name === GITHUB_COPILOT || name === GITHUB_COPILOT_CLI) {
return {
isAgent: true,
agent: { name: GITHUB_COPILOT }
};
}
return {

@@ -95,2 +104,5 @@ isAgent: true,

}
if (process.env.COPILOT_MODEL || process.env.COPILOT_ALLOW_ALL || process.env.COPILOT_GITHUB_TOKEN) {
return { isAgent: true, agent: { name: GITHUB_COPILOT } };
}
try {

@@ -97,0 +109,0 @@ await (0, import_promises.access)(DEVIN_LOCAL_PATH, import_node_fs.constants.F_OK);

{
"name": "@vercel/detect-agent",
"version": "1.2.0",
"version": "1.2.1",
"description": "Detect if code is running in an AI agent or automated development environment",

@@ -5,0 +5,0 @@ "keywords": [

@@ -35,2 +35,3 @@ # @vercel/detect-agent

- **Antigravity** (Google DeepMind)
- **GitHub Copilot** (via `AI_AGENT=github-copilot|github-copilot-cli`, `COPILOT_MODEL`, `COPILOT_ALLOW_ALL`, or `COPILOT_GITHUB_TOKEN`)
- **Replit** (online IDE)

@@ -37,0 +38,0 @@