推出 GPT-5 時,我們新增了安全檢查,用來辨識危險資訊並阻止使用者取得這類資訊。日後可能會有使用者嘗試透過你的應用程式從事違反 OpenAI 政策的活動,尤其是用途廣泛的應用程式。
我們依風險門檻對傳送給 GPT-5 的請求進行分類。
如果你的組織多次觸及高風險門檻,OpenAI 會傳回錯誤並寄送警告電子郵件。
如果超過指定期限(通常為七天)後,這類請求仍持續出現,我們就會終止你的組織對 GPT-5 的存取權。之後的 GPT-5 請求都會失敗。
如果你的組織出現違反安全政策的可疑活動,我們可能會傳回錯誤、限制模型存取權,甚至封鎖你的帳戶。下列安全措施有助於我們找出高風險請求的來源,讓我們能只封鎖個別終端使用者,避免封鎖整個組織。
如果你的產品讓個別使用者與模型互動,我們建議你導入安全識別碼 ,但這並非強制要求。
如果你需要使用限制較少的服務版本,才能開發對生命科學領域有益的應用,請參閱特殊存取計畫 ,確認你是否符合資格。
若要將特定安全識別碼的警告與停用通知送到你的調查或支援工作流程,請參閱安全政策執行通知 。
支援 safety_identifier 參數的 API 包括 Responses API 、Chat Completions API 和 Images API 。Realtime API 透過 OpenAI-Safety-Identifier 標頭支援相同功能。使用安全識別碼時,請在每個請求中提供該終端使用者固定不變的識別碼。請先將使用者的電子郵件地址或內部使用者 ID 雜湊,再傳送雜湊值,以免傳送任何個人資訊。
安全識別碼不會自動沿用到其他 API 或工作階段。即使你的應用程式已在 Responses API 請求中傳送 safety_identifier,仍須在每個 Images API 請求中,以及每次建立或連線至 Realtime 工作階段時,分別傳送同一個識別碼值。
使用 Images API 時,請在每個圖像生成或編輯請求中加入 safety_identifier。識別碼長度不得超過 128 個字元。請參閱圖像安全識別碼 ,瞭解如何從已棄用的 user 參數遷移。
Responses API Chat Completions API Realtime API Responses API
1
2
3
4
5
6
7
8
9
10
11 import OpenAI from "openai" ;
const client = new OpenAI ();
const response = await client.responses. create ({
model: "gpt-5.6-terra" ,
input: "This is a test" ,
safety_identifier: "user_123456" ,
});
console. log (response.output_text); 1
2
3
4
5
6
7
8
9 from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5.6-terra",
input="This is a test",
safety_identifier="user_123456",
) 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/responses"
)
func main() {
client := openai.NewClient()
response, err := client.Responses.New(context.Background(), responses.ResponseNewParams{
Model: "gpt-5.6-terra",
Input: responses.ResponseNewParamsInputUnion{OfString: openai.String("This is a test")},
SafetyIdentifier: openai.String("user_123456"),
})
if err != nil {
panic(err)
}
fmt.Println(response.OutputText())
} 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.responses.ResponseCreateParams;
ResponseCreateParams params =
ResponseCreateParams.builder()
.model("gpt-5.6-terra")
.input("Help me plan a study schedule.")
.safetyIdentifier("user_1234")
.build();
client.responses().create(params).output().stream()
.flatMap(item -> item.message().stream())
.flatMap(message -> message.content().stream())
.flatMap(content -> content.outputText().stream())
.forEach(text -> System.out.println(text.text())); 1
2
3
4
5
6
7
8
9
10 require "openai"
client = OpenAI::Client.new
response = client.responses.create(
model: "gpt-5.6-terra",
input: "Help me plan a study schedule.",
safety_identifier: "user_1234"
)
puts(response.output_text) 1
2
3
4
5
6
7
8 curl https://api.openai.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-5.6-terra",
"input": "This is a test",
"safety_identifier": "user_123456"
}' Chat Completions API
1
2
3
4
5
6
7
8
9
10
11 import OpenAI from "openai" ;
const client = new OpenAI ();
const response = await client.chat.completions. create ({
model: "gpt-5.6-terra" ,
messages: [{ role: "user" , content: "This is a test" }],
safety_identifier: "user_123456" ,
});
console. log (response.choices[ 0 ].message.content); 1
2
3
4
5
6
7
8
9 from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-5.6-terra",
messages=[{"role": "user", "content": "This is a test"}],
safety_identifier="user_123456",
) 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
)
func main() {
client := openai.NewClient()
response, err := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
Model: "gpt-5.6-terra",
Messages: []openai.ChatCompletionMessageParamUnion{openai.UserMessage("This is a test")},
SafetyIdentifier: openai.String("user_123456"),
})
if err != nil {
panic(err)
}
fmt.Println(response.Choices[0].Message.Content)
} 1
2
3
4
5
6
7
8
9
10
11
12
13
14 import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.chat.completions.ChatCompletionCreateParams;
ChatCompletionCreateParams params =
ChatCompletionCreateParams.builder()
.model("gpt-5.6-terra")
.addUserMessage("Help me plan a study schedule.")
.safetyIdentifier("user_1234")
.build();
client.chat().completions().create(params).choices().stream()
.flatMap(choice -> choice.message().content().stream())
.forEach(System.out::println); 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 require "openai"
client = OpenAI::Client.new
completion = client.chat.completions.create(
model: "gpt-5.6-terra",
messages: [
{
role: :user,
content: "Help me plan a study schedule."
}
],
safety_identifier: "user_1234"
)
puts(completion.choices.fetch(0).message.content) 1
2
3
4
5
6
7
8
9
10 curl https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-5.6-terra",
"messages": [
{"role": "user", "content": "This is a test"}
],
"safety_identifier": "user_123456"
}' Realtime API
1
2
3
4
5
6
7
8
9
10 curl https://api.openai.com/v1/realtime/client_secrets \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY " \
-H "OpenAI-Safety-Identifier: user_123456" \
-d '{
"session": {
"type": "realtime",
"model": "gpt-realtime-2.1"
}
}'
如果 OpenAI 的監控系統偵測到可能的濫用行為,我們可能會採取不同程度的措施:
延遲串流回應
對於可能違反政策的使用者,OpenAI 初期可能會採取影響較小的措施,先延遲串流回應並執行額外檢查,再將完整回應傳回給該使用者。
通過檢查後,串流就會開始。如果未通過檢查,請求就會中止,使用者不會收到任何 Token,串流回應也不會開始。
為了改善終端使用者體驗,可考慮在串流延遲時顯示載入動畫。
封鎖個別使用者的模型存取權
如果 OpenAI 有高度把握判定某項活動違反政策,就會全面禁止使用相關的 safety_identifier 存取 OpenAI 模型。
此後,所有使用同一安全識別碼的 GPT-5 請求都會收到 identifier blocked 錯誤。OpenAI 目前無法解除對個別識別碼的封鎖。
為確保封鎖有效,請採取措施,防止遭封鎖的使用者開設新帳戶。請留意,如果你的組織多次違反政策,整個組織都可能失去存取權。
隨著實際使用情況改變或新模型推出,具體的政策執行標準也可能調整。目前,如果某個安全識別碼涉及有風險或可疑的生物學或化學活動,OpenAI 可能會限制或封鎖該識別碼的存取權。請參閱這篇部落格文章 ,瞭解我們如何因應 AI 在生物學領域日益提升的能力。
如需瞭解工具和模型自訂功能各自的安全措施,請參閱使用電腦時如何取得使用者確認與同意 和微調安全措施 。OpenAI 也會在模型評估中心 公布評估結果。