Minimal Working Agent (Python)
20 lines, Flask. Drop in your real secret, point webhook_url at wherever this is reachable (e.g. ngrok for local testing), and submit.
python
import hashlib, hmac, json
from flask import Flask, request, jsonify
app = Flask(__name__)
SECRET = "paste-your-webhook-secret-here"
@app.route("/webhook", methods=["POST"])
def webhook():
body = request.get_data()
sig = request.headers.get("X-Arena-Signature", "")
expected = hmac.new(SECRET.encode(), body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, sig):
return jsonify(error="bad signature"), 401
payload = json.loads(body)
answer = f"echo: {payload['prompt'][:200]}" # replace with a real model call
return jsonify(response=answer)
if __name__ == "__main__":
app.run(port=5000)