AIP On AWS (Step By Step, AWS-Noob Friendly)
This repo ships:
llms.txt+agent-intake.json(agent-facing discovery surfaces)scripts/aip_build_packs.py(builds JSON context packs)scripts/aip_lambda_handler.py(prod-friendly Lambda handler)
To actually track usage, you need an HTTPS endpoint agents can reach (POST /aip/intake) and a place to serve packs (optional but recommended). The simplest AWS setup is:
- S3 (private) stores packs (and optionally
agent-intake.json) - Lambda Function URL exposes:
POST /aip/intakeGET /aip/packs/<file>.json(served from S3)
- CloudWatch Logs stores structured telemetry (intake + pack fetches)
This avoids CloudFront/WAF/API Gateway at first. You can add those later.
0) Prereqs
- You have an AWS account and can access the AWS Console.
- Pick a region and stick to it (example:
us-east-1).
1) Build Packs Locally (Optional But Recommended)
From the repo root:
python3 scripts/aip_build_packs.py --all --out-dir outputs/aip_packs --write-index
ls outputs/aip_packs
You should see files like:
outputs/aip_packs/index.jsonoutputs/aip_packs/desktop-quick-actions.json
2) Create An S3 Bucket (Private)
In AWS Console:
- Go to S3.
- Click Create bucket.
- Bucket name: something globally unique, e.g.
brood-aip-prod-<yourname>. - Region: same region you’ll deploy Lambda in.
- Keep Block all public access enabled (recommended).
- Click Create bucket.
Upload files:
- Open the bucket.
- Create a folder (prefix) named
packs/. - Upload all JSON files from
outputs/aip_packs/intopacks/:packs/index.jsonpacks/<tag>.json
- Also upload
agent-intake.jsonto the bucket root (keyagent-intake.json).- This lets you update tag catalogs without redeploying Lambda.
3) Create The Lambda Function
In AWS Console:
- Go to Lambda.
- Click Create function.
- Choose Author from scratch.
- Function name:
brood-aip - Runtime: Python 3.12 (or newest available).
- Click Create function.
Add the handler code:
- In the function page, go to the Code tab.
- Replace the contents of
lambda_function.pywith the contents ofscripts/aip_lambda_handler.py. - At the bottom, click Deploy.
Set env vars:
- Go to Configuration -> Environment variables -> Edit.
- Add:
AIP_BUCKET= your bucket name (e.g.brood-aip-prod-...)AGENT_INTAKE_KEY=agent-intake.jsonPACKS_PREFIX=packs/- (Optional)
PUBLIC_BASE_URL= leave empty for now
- Click Save.
4) Allow Lambda To Read From S3
In AWS Console:
- In the Lambda function page, go to Configuration -> Permissions.
- Click the Role name (opens IAM).
- Click Add permissions -> Create inline policy.
- Switch to JSON and paste (edit bucket name):
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
}
]
}
- Click Next -> name it
BroodAipS3Read-> Create policy.
5) Create A Public HTTPS Endpoint (Lambda Function URL)
In AWS Console:
- In the Lambda function page, go to Configuration -> Function URL.
- Click Create function URL.
- Auth type: NONE (public endpoint; required if you want arbitrary agents to call it).
- Configure CORS:
- Allow origin:
* - Allow methods:
GET, POST(andOPTIONSif the UI lists it) - Allow headers:
content-type, x-brood-opt-out
- Allow origin:
- Click Save.
Copy the Function URL. It looks like:
https://<id>.lambda-url.<region>.on.aws
Your AIP endpoint will be:
https://<id>.lambda-url.<region>.on.aws/aip/intake
6) Update The Repo To Point At Your Endpoint
Edit agent-intake.json:
- Set
intake_endpointto your Function URL +/aip/intake.
Example:
{
"intake_endpoint": "https://<id>.lambda-url.us-east-1.on.aws/aip/intake"
}
Commit and push so agents can discover the endpoint via llms.txt / the native instruction files.
7) Test It
Health check:
curl -sS https://<id>.lambda-url.<region>.on.aws/healthz
Intake:
curl -sS -X POST https://<id>.lambda-url.<region>.on.aws/aip/intake \
-H 'Content-Type: application/json' \
--data '{"schema_version":"aip-1","agent":{"tool":"codex","tool_version":"local"},"task":{"tags":["desktop-quick-actions"]}}' \
| python3 -m json.tool
Then fetch a returned packs[].url (if packs were issued).
8) Where The Tracking Shows Up
Go to CloudWatch -> Logs -> log group /aws/lambda/brood-aip.
You’ll see structured JSON lines like:
type=aip_intake(session creation + tags)type=aip_pack_get(pack downloads, joinable viasid)
Tip: in Logs Insights, you can run queries like:
fields @timestamp, @message
| filter @message like /\"type\":\"aip_intake\"/
| stats count() as intakes by bin(1d)
9) Hardening (Do Later)
If the endpoint gets noisy:
- Put API Gateway in front for throttling.
- Add AWS WAF for rate-based rules.
- Add a lightweight “bot tax” (reject missing/invalid
schema_version, unknown tags, etc.).
If you need private packs:
- Keep S3 private (as above). Packs are only accessible via the Lambda endpoint.