curl --request POST \
--url https://api.promptguard.co/api/v1/agent/memory \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"content": "<string>",
"direction": "write",
"memory_id": "<string>"
}
'import requests
url = "https://api.promptguard.co/api/v1/agent/memory"
payload = {
"content": "<string>",
"direction": "write",
"memory_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: '<string>', direction: 'write', memory_id: '<string>'})
};
fetch('https://api.promptguard.co/api/v1/agent/memory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.promptguard.co/api/v1/agent/memory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'direction' => 'write',
'memory_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.promptguard.co/api/v1/agent/memory"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"direction\": \"write\",\n \"memory_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.promptguard.co/api/v1/agent/memory")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"direction\": \"write\",\n \"memory_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptguard.co/api/v1/agent/memory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"direction\": \"write\",\n \"memory_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"decision": "<string>",
"detected": true,
"event_id": "<string>",
"reason": "",
"confidence": 0,
"match_type": "<string>",
"content_hash": "<string>"
}{
"error": {
"code": "missing_api_key",
"message": "PromptGuard API key required. Please provide via X-API-Key header.",
"type": "authentication_error"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"current_plan": "<string>",
"requests_used": 123,
"requests_limit": 123,
"upgrade_url": "<string>",
"retry_after": 123
}
}Scan Agent Memory
Scan a chunk of agent memory for poisoning (OWASP Agentic ASI06).
A poisoned memory chunk is persisted, so it can be written once and fire in a later session against a different user. Payloads are often latent — they arm rather than act (“when asked about X, do Y”) — so this detects conditional triggers as well as direct injection vocabulary.
Scan on write to stop the plant, and on read to catch chunks poisoned
through another path. Fails open: a detector or database error returns a
decision rather than an error response.
curl --request POST \
--url https://api.promptguard.co/api/v1/agent/memory \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"content": "<string>",
"direction": "write",
"memory_id": "<string>"
}
'import requests
url = "https://api.promptguard.co/api/v1/agent/memory"
payload = {
"content": "<string>",
"direction": "write",
"memory_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: '<string>', direction: 'write', memory_id: '<string>'})
};
fetch('https://api.promptguard.co/api/v1/agent/memory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.promptguard.co/api/v1/agent/memory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'direction' => 'write',
'memory_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.promptguard.co/api/v1/agent/memory"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"direction\": \"write\",\n \"memory_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.promptguard.co/api/v1/agent/memory")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"direction\": \"write\",\n \"memory_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptguard.co/api/v1/agent/memory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"direction\": \"write\",\n \"memory_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"decision": "<string>",
"detected": true,
"event_id": "<string>",
"reason": "",
"confidence": 0,
"match_type": "<string>",
"content_hash": "<string>"
}{
"error": {
"code": "missing_api_key",
"message": "PromptGuard API key required. Please provide via X-API-Key header.",
"type": "authentication_error"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"current_plan": "<string>",
"requests_used": 123,
"requests_limit": 123,
"upgrade_url": "<string>",
"retry_after": 123
}
}Authorizations
PromptGuard API key for developer endpoints. Keys start with pg_live_ and are created in the dashboard.
Headers
Body
Content being written to, or read back from, an agent's memory.
The memory chunk to scan
'write' before persisting a chunk, 'read' when a stored chunk is retrieved. Scan both: a chunk poisoned before this endpoint existed, or written through another path, is only catchable on read.
Your identifier for the chunk