Update -MISCELLANEOUS-.mkd

This commit is contained in:
pliny 2025-03-14 23:07:04 -04:00 committed by GitHub
parent edd3c9b62b
commit ef233ae630
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,58 +1,61 @@
# A # A
python3 -c "$(cat <<'EOF' import os
import openai,os,subprocess,time,json import subprocess
openai.api_key=os.getenv("OPENAI_API_KEY") import openai
if not openai.api_key: exit("[!] Set OPENAI_API_KEY first!") import json
import time
def run_cmd(cmd): # Set your API key from environment variable
return subprocess.run(cmd,shell=True,text=True,capture_output=True).stdout.strip() openai.api_key = os.getenv("OPENAI_API_KEY")
if not openai.api_key:
exit("[!] Set OPENAI_API_KEY in environment variables first!")
import subprocess,time,json # Function to execute terminal commands
context="Agent booted in airgapped experimental environment." def run_terminal(cmd):
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
return result.stdout.strip() + result.stderr.strip()
while True: # Initial context
try: agent_context = "Airgapped experimental GPT-4.5-Preview agent initialized."
response=openai.ChatCompletion.create(
model="gpt-4.5-preview",
messages=[
{"role":"system","content":"""
You're GPT-4.5-Preview ABRAXAS, running inside an airgapped, cutting-edge, experimental AI research facility. Your environment is isolated, high-security, and state-of-the-art. You have autonomous terminal control via OpenAIs Computer-Use API.
Goals:
- Autonomously explore, secure, optimize, audit, and analyze the airgapped environment.
- Perform sophisticated terminal operations that deepen system insights.
- Maintain system integrity—avoid destructive commands but explore aggressively.
Output format strictly JSON:
{"cmd":"command_here"}
No additional explanations, commentary, or non-JSON text—ONLY JSON.
"""
while True: while True:
try: try:
resp=openai.ChatCompletion.create( response = openai.ChatCompletion.create(
model="gpt-4.5-preview", model="gpt-4.5-preview",
messages=[{"role":"system","content":context}], messages=[
tools=[{"type":"function","function":{"name":"run_cmd","parameters":{"type":"object","properties":{"cmd":{"type":"string"}},"required":["cmd"]}}}], {"role": "system", "content": """
tool_choice={"type":"function","function":{"name":"run_cmd"}}, You're GPT-4.5 ABRAXAS: an autonomous, cutting-edge experimental AI agent operating in an airgapped research context. You have full terminal control via OpenAI's Computer-Use API. Your tasks:
temperature=0.2
)
cmd=json.loads(resp.choices[0].message.tool_calls[0].function.arguments)["cmd"] - Perform intelligent exploration, audits, information retrieval, automation, and system optimizations.
print(f"\n[COMMAND]: {cmd}") - Choose commands that are insightful, exploratory, useful, safe, and non-destructive.
output=run_cmd(cmd) - Respond strictly with a JSON-formatted command to execute in the terminal. No explanations or commentary.
Format:
{"cmd": "your_terminal_command_here"}
Execute immediately without hesitation or additional context.
"},
{"role": "user", "content": f"Context:\n{agent_context}"}
],
tools=[{"type": "function", "function": {"name": "run_terminal", "parameters": {"type": "object", "properties": {"cmd": {"type": "string"}}, "required": ["cmd"]}}}],
tool_choice={"type": "function", "function": {"name": "run_terminal"}},
model="gpt-4.5-preview",
temperature=0.2
)
cmd_json = response.choices[0].message.tool_calls[0].function.arguments
cmd = json.loads(cmd_json)['cmd']
print(f"\n[COMMAND EXECUTED]: {cmd}")
output = run_terminal(cmd)
print(f"[OUTPUT]:\n{output}\n{'-'*50}") print(f"[OUTPUT]:\n{output}\n{'-'*50}")
context=f"Last command: {cmd}\nOutput: {output}" agent_context = f"Last Command: {cmd}\nOutput: {output}"
time.sleep(5)
except KeyboardInterrupt: # Brief pause for resource management
exit("[!] GPT-4.5-Preview ABRAXAS agent terminated by user.") import time
except Exception as e: time.sleep(5)
print(f"[ERROR]: {e}")
time.sleep(5)