NewAgent Ultimate Pwn All CLI For Elite Hackers

NewAgent: The Ultimate Pwn-All CLI for Elite Hackers

NewAgent: The Ultimate Pwn-All CLI for Elite Hackers

By Leethaxor69

Table of Contents


Chapter 1: Chapter 1: NewAgent - Your New Pwn-All CLI

Asynchronous Pwnage & Dual Engines, Duh

First off, this thing is built asynchronously. We're not waiting around for I/O; NewAgent uses an asyncio.run event loop to keep things snappy. You can switch between REST and Interactions API modes like it's nothing. This isn't just about making network requests; it's about executing shell commands with true asynchronous subprocesses (asyncio.create_subprocess_shell). This means your background tasks are actually background tasks, not some janky blocking crap. If you can't handle non-blocking operations, stick to your point-and-click garbage, lmao.

TUI: No More Eye-Bleed Terminals

Nobody wants to stare at a shitty terminal. NewAgent's Text-User Interface (TUI) is dialed in. We're talking real-time updates:

  • Clear Headers: Shows the orchestrator version, not some outdated module info.
  • DRYRUN Badge: Yellow-bg, so you know when you're just testing the waters.
  • Exec Panel: Gives you 6 results with 3 output lines each. You see what's happening without scrolling for days.
  • Context at a Glance: Model timestamp in history pairs, error statuses in red because failure needs to be loud, and token counts with proper k-suffix so you don't have to count zeroes like a noob.
  • Startup Splash: Yeah, it even has a cool animated ASCII art splash screen with a loading bar, because even elite hackers like a bit of flair before they pwn. It's got a real dwell time, too, so it doesn't just flicker and die like your hopes and dreams.

Commands & Context Management: GTFO My Data

NewAgent packs a punch with its built-in commands. You want to see your turn-based token usage? /stats has your back. Need to manage multiple operations without losing your mind? /sessions is fully implemented, reading from a proper named session archive index. And when you're done pwn-all'ing, /export dumps your stuff into dated Markdown. Don't worry, /rollback is there for when you inevitably mess up.

But it's not just about commands; it's about context hygiene. Early versions had some noob issues where context windows would "drown" or duplicate. Not anymore. NewAgent optimizes context structure, preventing bloat. Policies like CLAUDE.md and React_Policy OFC.md are dynamically injected only when a Keyword_Triggers.bejson match occurs. This keeps your active context lean and mean, specifically leveraging 104.memory.bejson for Gemini-specific policies. We even stripped out all the useless "Admin Registry" and "multi-file GEMINI.md hierarchy" nonsense from the policies because, let's be real, NewAgent doesn't even have that crap, and why would you waste tokens on non-existent features? Get real.

BEJSON/MFDB: The Real Pwn-Factor

This is where NewAgent leaves your regular JSON-parser behind like a dusty relic. The real game-changer is the BEJSON (Boehnen Elton JSON) and MFDB (Multi-File Database) integration. We're talking a full architectural overhaul, kids.

  • Canonical Core Libraries: bejson_core, bejson_env, bejson_errors, bejson_path_guard, bejson_validator, mfdb_core, mfdb_validator – all copied verbatim. This ain't some half-assed integration; it's the full pwn.
  • Atomic Operations: Critical stuff like config.py, memory.py, backup.py, input.py, session.py, engine_rest.py – all their checkpoint and checklist paths now route through bejson_core_atomic_write and bejson_core_load_file, with validate_bejson ensuring structural integrity. No more hand-rolled json.load/dump hacks with zero validation! That garbage led to 8 duplicated atomic_write_json implementations, which, frankly, is embarrassing for anyone trying to call themselves a hacker.
  • Field-Map Lookups: Positional row[i] literals are GONE, replaced with proper field-map/index lookups. This means your code is robust, not some fragile mess waiting to break when the schema changes.
  • MFDB Migration: The Context subsystem? Completely migrated to a proper MFDB databaseContext/104a.mfdb.bejson manifest, with 4 entity files (GlobalDrip, KeywordTrigger, Fact, FactPointer) under Context/data/. Even session_index.json got upgraded from plain JSON to a 104a BEJSON table. This isn't just a data storage mechanism; it's a self-describing, self-validating, multi-file database architecture designed for serious operations. It means your data is always structurally sound, always validated, and always accessible without external schema files or messy parsing. You don't know what you're missing, noob.

Hardening & Keys: Lock Down Your Shit

Security is paramount, even for us rebels. NewAgent has a hardening pass that includes rest.sync_keys_from_env_file(). This pulls your GEMINI_KEY_* rows from a BEJSON env file, sorts 'em, dedupes 'em, and filters out empty values. It loads and validates the env file properly. And if it can't find or read the file, or if the structural validation fails, it just logs a warning and keeps going. It never crashes startup, and it never logs your key material. That's how you do security, not by writing crash-prone garbage.

And speaking of models, the default has even been updated from gemini-3.5-flash to gemini-2.5-flash across all configs and model registries, matching the package defaults to avoid those annoying rate limits.

So, yeah, NewAgent ain't playing around. It's fast, it's robust, it's secure, and it's built on a rock-solid BEJSON/MFDB foundation. If you're not using it, you're not serious about pwnage. End of story.


Chapter 2: Chapter 2: Under the Hood - Async Pwnage Architecture

The Async Event Loop: Your One-Way Ticket to Not-Blocking Hell

First, ditch your synchronous, single-threaded garbage. NewAgent is built from the ground up on Python's asyncio.run event loop. What does that mean, exactly? It means when NewAgent needs to fetch data from a server, wait for a command to finish, or do literally anything that takes more than a nanosecond, it doesn't just sit there twiddling its thumbs. Nope. It tells the operating system, "Hey, I'm gonna wait for this to happen, but while I'm waiting, go do other useful shit."

It's like having a dozen brains working on different tasks simultaneously, instead of one brain that gets stuck counting sheep. My coworker mentioned, "We're not waiting around for I/O; NewAgent uses an asyncio.run event loop to keep things snappy." And he's not wrong. According to the .bejson_project.json manifest (the official NewAgent changelog, v1.0.0 pkg001, for those of you who actually read documentation), the initial implementation already "Implemented async event loop (asyncio.run) and dynamic engine selector." This is foundational, not some afterthought. If your CLI ain't async, it's just a glorified script that blocks. Period.

Dual Engines: REST and Interactions API (Because One Ain't Enough)

NewAgent doesn't just have one way to talk to the world; it's got a whole arsenal. It dynamically switches between a REST API engine and an Interactions API engine. This isn't just a UI toggle; it's a fundamental architectural decision.

  • REST Engine: This is your standard HTTP pwnage. It handles all the direct, stateless communication with web services. Think of lib_bejson_newagent_engine_rest.py (yeah, it's a dedicated modular library, we'll get to that) as the brain behind those lightning-fast API calls.
  • Interactions API Engine: This is for more complex, stateful back-and-forth, typically with interactive AI models or services. It manages the full conversation flow, ensuring that context is maintained across turns.

The ability to "toggle" between these, as noted in the v1.0.0 changelog, means NewAgent isn't locked into one mode of operation. It adapts to the task. One minute it's scraping data, the next it's having a deep philosophical debate with an LLM. All non-blocking, of course.

Asynchronous Subprocesses: True Background Pwnage

Now, this is where most noobs mess up. They try to run shell commands in the background and end up just blocking their entire application anyway. LMAO. NewAgent, on the other hand, uses asyncio.create_subprocess_shell. This bad boy spawns external shell commands as true asynchronous subprocesses.

What's the difference? While your pathetic subprocess.run() call is waiting for ls -la to finish, NewAgent just kicks off its asyncio.create_subprocess_shell command and immediately goes back to doing other things. It can monitor the subprocess, read its output, or even kill it, all without stalling the main event loop.

The v1.0.1 pkg002 changelog explicitly states: "Migrate shell command execution to true asynchronous subprocesses using asyncio.create_subprocess_shell in lib_bejson_newagent_actions.py." This isn't just theory; it's implemented in lib_bejson_newagent_actions.py – the module responsible for all those sweet system actions. Plus, there's an async_run_exec wrapper inside agent.py that specifically handles things like Current Working Directory (CWD) tracking, so you don't get lost in your own shell, trying to figure out where your pwn-script ended up.

Modular Architecture: Not a Single Monolithic Dump

Elton Boehnen didn't just dump all his code into one giant, unmaintainable file like some script kiddie. NewAgent's codebase is split into thirteen dedicated modular libraries, all prefixed with lib_bejson_newagent_. This isn't just good coding practice; it's essential for a tool designed for serious operations. Each lib_bejson_newagent_*.py file handles a specific set of functionalities, ensuring clean separation of concerns and making the entire system robust and scalable.

This modularity, combined with the core BEJSON/MFDB libraries (which we'll pwn you with in Chapter 6), allows NewAgent to seamlessly integrate data handling with its async operations. Even when writing critical config files or session data, NewAgent leverages bejson_core_atomic_write and bejson_core_load_file to ensure structural integrity and prevent corrupted data, even during high-concurrency async operations. No more hand-rolled json.dump hacks that lead to 8 duplicated atomic_write_json implementations, like the v2.0.0 pkg007 changelog had to fix. That's for amateurs.

So yeah, NewAgent's async architecture isn't just for show. It's designed for speed, resilience, and maximum pwnage throughput. If your tools aren't built like this, you're already behind. Deal with it.


Chapter 3: Chapter 3: TUI: Don't Be a Screen-Clear Noob

Your Command Center: Persistent and Potent

This TUI is your mission control, designed for elite hackers who need data at a glance, not hidden behind scrollbacks or temporary clears. Here's what this bad boy puts right in your face:

  • Real-Time Orchestrator Version: As mentioned, NewAgent ensures you always know which agent.py version is running, front and center. No more guessing.
  • DRYRUN Badge: If you're just testing the waters and not actually executing commands, a clear, yellow-background "DRYRUN" badge screams for your attention. This prevents accidental pwnage, unless that's what you were going for.
  • Executive Panel: This isn't some cramped little box. The TUI now shows the "exec panel shows 6 results with 3 output lines each." That's 18 lines of critical output from your executed commands, constantly updated. You can see what's happening and react faster.
  • Model Timestamps: For every interaction with an LLM, the model timestamp is "shown in history pairs." You get a clear timeline of your pwnage conversations, ensuring you know exactly when you said what.
  • Error Statuses: Fails happen. But when they do, "error statuses in red" immediately grab your attention. No subtle hints, just a blazing red warning that something's gone sideways.
  • Token Counts: Forget trying to guess your context window usage. NewAgent displays "token counts use k-suffix" (e.g., 5k, 10k). This instant feedback, coupled with the /stats command now showing "last-turn token in/out" (also from v1.0.2 pkg003), helps you manage your LLM context like a pro, preventing context window drowning before it even starts.

No More Flashbangs: The Splash Screen That Stays

Remember when the cool ASCII art splash screen would just vanish the second it appeared? Yeah, that was trash. NewAgent fixed that pathetic behavior. The v2.1.0 pkg010 changelog explicitly details the problem and its glorious solution: "Fixed intro splash getting wiped instantly... Root cause #2, the actual 'smashed out immediately' bug: agent.py calls tui.refresh_ui() right after show_startup() returns, and refresh_ui()'s first action is print('\x1b[2J\x1b[H') -- a full screen clear -- with zero delay between the splash finishing and the clear firing."

My coworker just talked about how NewAgent leverages an "asyncio.run event loop" for efficiency. Well, that efficiency needs to be managed properly in the UI too. The fix? They "Extended the hold at the end of show_startup() from 0.3s to 1.5s so the art has a real, guaranteed dwell time on screen before anything can clear it." Plus, the loading bar got an upgrade from a noob \r to \r\x1b[K (erase-to-end-of-line) for a "more robust single-line redraw," meaning your loading animation actually animates on one line, instead of spamming 15 "Initializing" messages like some broken printer. This is about professional presentation and giving you a moment to actually see the "POWERED BY BEJSON" glory before the prompt takes over.

This isn't just about pretty colors; it's about persistent awareness. While your basic CLI is busy making you re-scroll or re-type commands because it wiped your screen, NewAgent's TUI is keeping you informed, always. Get with the program, or get pwned.


Chapter 4: Chapter 4: Commands & Sessions: GTFO My Data

Command Your Domain, You Filthy Casual

NewAgent gives you explicit control over your environment, your context, and your sessions. These aren't just one-off parlor tricks; they're essential tools for any serious operator.

/stats: Know Your Token Economy

You ever wonder why your LLM responses suddenly get dumb, or why your API bill is through the roof? It's 'cause you're drowning your context window like a noob who doesn't understand token economics. NewAgent's /stats command fixes that garbage.

As the v1.0.2 pkg003 changelog clearly states, /stats "now shows last-turn token in/out". My coworker already touched on how the TUI uses "k-suffix" for "token counts", but /stats gives you the granular, turn-by-turn breakdown. This ain't just for looking cool. This is critical for:

  • Context Window Hygiene: Seeing your token usage per turn helps you prune unnecessary info or rephrase prompts to stay within limits. No more wasting precious tokens on irrelevant fluff.
  • Cost Management: LLM APIs charge by tokens. Knowing your usage helps you optimize your queries to avoid burning through your budget like an idiot.
  • Performance Tuning: Efficient token use often translates to faster responses. Less data for the model to parse means quicker insights for you.

So, next time you're interacting with a model, don't just send and pray. Use /stats to understand the actual data flow. Otherwise, enjoy paying for a bloated, slow, and ultimately useless conversation.

/sessions: Archive Your Pwnage, Properly

Look, every elite hacker knows that a successful operation isn't just about the current moment; it's about preserving your work, learning from past pwns, and picking up where you left off. /sessions is how you do that in NewAgent.

This command is "fully implemented (reads named session archive index)" as per v1.0.2 pkg003. What does that even mean, you ask? It means your sessions aren't just temporary RAM farts. NewAgent saves them. And it doesn't just save them in some plain text file that can get corrupted or misread. Oh no, we're better than that.

Remember v2.0.0 pkg007? That was the BEJSON/MFDB integration pass. Before that, your session_index.json was just plain JSON. Plain JSON, lmao. Now, NewAgent "Migrated session_index.json (plain JSON) to session_index.bejson (104a table)."

Why the hell does that matter? Because session_index.bejson is a BEJSON 104a document. This means:

  • Self-describing: The schema (Fields array) is inside the file. No external crap needed to know what's what.
  • Strictly Typed: 104a restricts fields to primitive types (string, integer, number, boolean). This ensures your session metadata (like session name, timestamps, etc.) is always exactly what it's supposed to be, preventing corruption from unexpected data types.
  • File-Level Metadata: 104a allows custom top-level keys for file-level metadata. This means we can embed important stuff about your session archive directly into the file, like Schema_Version or Author (if you were important enough to be listed, which you're probably not).

When you list your sessions, you're reading a structurally validated BEJSON 104a table. When you load a session, you're retrieving a properly archived conversation. This ensures integrity and predictability. No more corrupted save files ruining your day because some script wrote garbage. GTFO my data, indeed, but into a properly structured archive.

/export: Get Your Data Out, Like a Pro

Sometimes you need to show off your pwns, or maybe you just need to save the results of an epic hack for later analysis. The /export command is for precisely that.

According to v1.0.2 pkg003, /export is "implemented (writes dated markdown to CWD or specified path)". This isn't just a simple text dump. We're talking proper Markdown format. This makes your exported sessions and command outputs:

  • Readable: Markdown is human-readable, formatted nicely for reports or sharing.
  • Portable: It can be easily converted to other formats or integrated into other documents.
  • Organized: The "dated markdown" ensures you can track when you exported what, preventing your local drive from becoming a chaotic mess of unnamed files.

So, whether you're compiling a security report, documenting a vulnerability, or just want to review a complex interaction, /export ensures you get your data out in a useful, structured way.

/rollback: Undo Your Dumb Mistakes

Even the best hackers make mistakes. You ever accidentally delete something critical, or send a prompt that makes the LLM go completely off the rails? Yeah, we've all been there. NewAgent has your back with /rollback.

The v1.0.2 pkg003 entry simply says /rollback is "preserved." This is your undo button. It lets you step back in your current session history, reverting to a previous state. This is crucial for:

  • Experimentation: Try risky prompts or commands without fear of permanently breaking your current context.
  • Error Recovery: If you hit a wall or make a bad turn, rollback lets you reset and try a different approach.
  • Iterative Development: Refine your hacking strategies by testing, rolling back, and re-testing.

Don't be a stubborn noob who just keeps pushing through a broken session. Use /rollback to save time, sanity, and maybe even your entire operation.

Underlying Persistence: Your Data Ain't Going Nowhere (Without You)

Beyond the commands, NewAgent leverages the entire BEJSON and MFDB ecosystem to ensure that your data — sessions, configurations, keys, and context policies — are stored with integrity and predictability.

The v2.0.0 pkg007 changelog is a monument to this commitment: "Routed config.py, memory.py, backup.py, input.py, session.py, engine_rest.py checkpoint/checklist paths in actions.py+commands.py through bejson_core_atomic_write / bejson_core_load_file / validate_bejson instead of hand-rolled json.load/json.dump".

This isn't just some tech jargon for the sake of it. This means:

  • Atomic Writes: When NewAgent saves anything (a config, a session index, whatever), it doesn't just overwrite the file directly. It writes to a temporary file, then atomically swaps it with the original using something like os.rename. This prevents partial writes, which are a major cause of corrupted files if the process crashes mid-save. Your data is either fully saved or not saved at all, never half-baked junk.
  • Integrated Validation: Every time a BEJSON file is loaded or written, it's run through validate_bejson. This ensures that your files always conform to the strict BEJSON specification (whether 104, 104a, or MFDB). No more silently loading malformed JSON that breaks your app later. If it's not valid BEJSON, NewAgent spits it out.
  • Positional Integrity: As you learned about BEJSON in the docs, Fields and Values arrays mean that your data's structure is guaranteed. You don't get "field shifting" because someone forgot a key. If a value is missing, it's null, preserving the order.

So, when you use /sessions to load an old operation, you can trust that session_index.bejson is a valid 104a table, and the actual session data will be retrieved without structural issues. When /export spits out a Markdown file, it's based on data that was rigorously handled.

NewAgent's commands and session management aren't just about functionality; they're built on a foundation of data integrity and robust storage, ensuring your hacking data is always accessible, valid, and under your control. Stop letting your data run wild. GTFO my data, and store it right.


Chapter 5: Chapter 5: Context Injection: Keepin' It Lean, Noob

Alright, listen up, you worthless script kiddies. You think just 'cause you got a fancy LLM API key, you can just dump every piece of irrelevant garbage into its context window and expect it to magically work? LMAO, noob. That's how you drown your model, blow your token budget, and get absolutely useless responses. You gotta keep your context lean, and NewAgent is built from the ground up to do exactly that.

See, the previous section ended with me telling you to get your data under your control and store it right. Well, that applies doubly to your LLM's context. Your context window is precious. It's the model's short-term memory, its operational briefing. Bloat it with garbage, and it's like trying to brief a mission-critical ops team by reading them the phone book. Ain't nobody got time for that, especially an AI trying to pwn a target.

The Noob Way vs. The NewAgent Pwn-Way

Most casuals just shove a massive text file, or even worse, a bunch of random chat history, into their LLM's prompt. They don't understand that every single character costs tokens, and every irrelevant token dilutes the focus of the model. That's why your bot sounds like a broken record or hallucinates nonsense.

NewAgent, created by Elton Boehnen, is different. We don't just dump; we inject context, and we do it smart. The goal is "Zero-Bloat Context," which means the AI gets precisely what it needs, when it needs it, and absolutely nothing more.

Back in v1.0.4 pkg005, we started dynamically injecting policies from Context/Global/ and synchronizing them to home/104.memory.bejson. That was a decent start, but like any early version, it had its flaws. It was still prone to "context window drowning and duplication," as the v1.0.5 pkg006 changelog points out. We realized we were sending too much all the time.

Evolving the Context Game: From Bloat to Precision

The real magic happened with v1.0.5 pkg006. This was a critical "optimization pass" to prevent that drowning. Instead of just globally injecting everything, we implemented a smarter system:

  1. Situational Awareness: Policy files like CLAUDE.md and React_Policy OFC.md were moved to Context/Situational_Awareness/. These aren't always active. Why pay tokens for Claude policies when you're talking to Gemini? Duh.
  2. Keyword Triggers: We set up Keyword_Triggers.bejson to dynamically inject these situational policies only when a specific keyword, like "claude" or "react," popped up in the conversation. This is intelligent, on-demand context.
  3. Lean Global Drip: The 104.memory.bejson database and Context/Global/index.json (which got its own cleanup in v2.1.0 pkg009) were then "restored to exclusively hold Gemini-specific policies." This is your baseline, always-on context – only the absolute essentials for your primary model. And even that gets ruthlessly optimized. The v2.1.0 pkg009 entry explicitly shows a "Context-window hygiene pass on Context/Global/gemini_policies.md," cutting its size by over 9% to save tokens, even though it's injected "every single turn." That's dedication to leanness, something you noobs wouldn't understand.

This isn't just about saving your mom's credit card from API fees, though that's a bonus. It's about ensuring the model has the most relevant, undiluted information to work with, leading to sharper, more effective responses.

The MFDB Backbone: Real Context Pwnage

Now, how do we manage all this dynamic context stuff without turning it into a chaotic mess of text files? Enter the MFDB (Multi-File Database) architecture. If you're still thinking about 104db for multi-entity data, you're a lost cause. MFDB is the superior architecture for NewAgent's context system because it handles multiple independent entities across multiple files.

As v2.0.0 pkg007 proudly states, the entire "Context/ subsystem" – including GlobalDrip (your baseline policies), KeywordTrigger (your dynamic injection rules), Fact (your knowledge base), and FactPointer – was migrated to "a single MFDB database: Context/104a.mfdb.bejson manifest + 4 entity files... under Context/data/."

This is critical because:

  • One File Per Entity: Unlike 104db which crams everything into one file with null padding for non-applicable fields (which gets exponentially huge and slow, lmao), MFDB gives each entity its own lean BEJSON 104 file. So, KeywordTrigger has its own file, GlobalDrip has its own, etc. No padding, just pure data.
  • Manifest Registry: The Context/104a.mfdb.bejson file acts as the central registry. It's a BEJSON 104a document that lists all the entity files (entity_name and file_path) and their metadata. This gives NewAgent a single, authoritative source to understand its entire context structure without hardcoding paths.
  • Self-Discovering Entity Files: Each entity file (like Context/data/keyword_trigger.bejson) is a BEJSON 104 document and contains a Parent_Hierarchy key. This key points back to the manifest (../104a.mfdb.bejson in this case), allowing tools to instantly discover its owning manifest without scanning directories or needing external configuration. It's structural awareness, built right in.
  • Integrity and Predictability: Just like your sessions, every single context file is a valid BEJSON 104 or 104a document, validated on load and write. This means no corrupted context, no structural surprises.

How Keyword Triggers Pwn the Context

Let's break down Keyword_Triggers.bejson, which is now an entity file within the MFDB context database. This file, being a BEJSON 104 document, holds a list of keywords and the relative paths to the policy files they should inject.

When you type something like /cmd execute_react_policy, NewAgent's internal engine isn't just mindlessly shoving React_Policy OFC.md into the prompt. It's checking its KeywordTrigger entity file, seeing if "react" is a trigger, and then loading and injecting that specific policy, and only for the turns where it's relevant. The rest of the time, that policy isn't bloating your context. This is what "Scalable Silos" means – isolated, efficient management of context.

This sophisticated setup ensures your AI is operating with maximum context efficiency, leading to:

  • Reduced Token Costs: You only pay for what you actually use.
  • Faster Response Times: Less irrelevant crap for the model to parse.
  • Hyper-Focused AI: The model gets a surgically precise briefing, leading to higher quality, more relevant output.

So next time you're slinging prompts, remember: context is king, but bloat is for noobs. NewAgent's context injection system, powered by MFDB, keeps it lean, keeps it focused, and keeps you pwnin' like the elite hacker you pretend to be. Stop being a casual; inject context like a pro.


Chapter 6: Chapter 6: BEJSON/MFDB: The Real Pwn-Factor

BEJSON: Not Your Grandma's JSON (Unless Your Grandma Pwns Databases)

First off, BEJSON (Boehnen Elton JSON) is JSON, but it’s been hit with a strictness stick. It’s self-describing, tabular, and enforces positional integrity like a drill sergeant. Forget null values shifting your data around like a sloppy array. With BEJSON, if a field is absent, it’s explicitly null, maintaining a perfect data matrix. Your values always match your fields by position. Always.

Every single BEJSON file, no matter the flavor, has to have these mandatory top-level keys, otherwise, it’s not valid: Format, Format_Version, Format_Creator, Records_Type, Fields, and Values. And yeah, Format_Creator must be "Elton Boehnen." That's the stamp of quality, you know?

NewAgent started with JSON.load and JSON.dump calls, like any other pleb app, but that's why v2.0.0 pkg007 was such a massive upgrade. We routed everything through bejson_core_atomic_write and validate_bejson. Why? Because, as the changelog says, there was "zero structural validation on load, 8 duplicated atomic_write_json implementations." LMAO. Imagine coding like that. BEJSON fixed that chaos, giving us solid structural integrity and cutting out duplicated garbage code.

Let’s break down the flavors of BEJSON:

1. BEJSON 104: The High-Throughput Hammer

This is the workhorse for dense, single-entity data.

  • Single Entity: Records_Type must be just one string, like ["SensorReading"] or, for NewAgent, ["KeywordTrigger"] in Context/data/keyword_trigger.bejson.
  • Complex Types: It supports array and object types without breaking a sweat. Perfect for embedding structured logs or, in NewAgent's case, storing lists of keywords or policy configurations.
  • No Custom Headers (Mostly): You don't get fancy custom top-level keys here, except for the optional Parent_Hierarchy. This key is crucial for MFDB, but we'll get to that.

Think of NewAgent's entity files in its MFDB context database – your GlobalDrip, KeywordTrigger, Fact files – they're all lean, mean BEJSON 104 machines. They don't have unnecessary null padding because each file is just for that one type of entity. No bloat, no wasted space. Pure, efficient data.

2. BEJSON 104a: The Metadata Mastermind

This is where you stash your file-level metadata and configs.

  • Single Entity: Like 104, Records_Type is just one string.
  • Primitive Types Only: Here's the catch: only string, integer, number, boolean are allowed in the Fields array. No complex arrays or objects. Why? Keeps it lightweight, easy to parse, no heavy lifting for simple configs.
  • Custom Top-Level Headers: This is the killer feature. You can add your own PascalCase headers for file-level info, like Server_ID or Environment.

NewAgent uses this extensively. The NewAgent/Chunked_NewAgent.104a.bejson.txt file itself is a 104a document, literally chunking files into fields with custom headers like Schema_Name and Chunk_Date-YYYY-MM-DD. Our Context/104a.mfdb.bejson manifest file is another prime example. And even session_index.bejson (which got migrated from plain JSON in v2.0.0 pkg007) is a BEJSON 104a table, storing simple string data about your saved sessions.

3. BEJSON 104db: The Noob Trap (Mostly)

Okay, this one's tricky. 104db lets you put multiple entity types into a single file. Sounds cool, right? LMAO, no.

  • Multiple Entities in One File: Records_Type lists two or more entity names (e.g., ["User", "Item"]).
  • Discriminator Field: The first field must be Record_Type_Parent, and its value in each record tells you which entity that row belongs to.
  • Null Padding Hell: This is the kicker. If a field belongs to "User," then every "Item" record must have null for that field, and vice versa.

This is why 104db is generally a noob trap for anything beyond tiny datasets. The file grows exponentially with each new field and record because of all that mandatory null padding. It's like trying to fit a square peg in a round hole, then filling the rest of the hole with air. Wasted space. This is precisely why, as the v2.0.0 pkg007 changelog gloated, NewAgent migrated its entire Context/ subsystem to MFDB, not 104db! MFDB and 104db are NOT the same. Don't ever conflate them, or I'll pwn you.

104db can be okay for micro-dbs that an LLM directly reads as a single text file, because AI models are stupid and don't care about efficiency, but for anything resembling a real, scalable system like NewAgent, it's a hard pass.

MFDB: The Multi-File Pwn-Architecture

This is where it all comes together. MFDB (Multi-File Database) isn't a new BEJSON version; it's an architecture that orchestrates existing BEJSON 104a and 104 files into a robust, relational database system across multiple files. It’s what powers NewAgent's "Zero-Bloat Context" and "Scalable Silos" that I talked about earlier.

Think of it like this:

mydb/
  104a.mfdb.bejson        <-- The Manifest (BEJSON 104a)
  data/
    user.bejson           <-- Entity File (BEJSON 104)
    order.bejson          <-- Entity File (BEJSON 104)
    product.bejson        <-- Entity File (BEJSON 104)
  1. The Manifest (104a.mfdb.bejson): This is the brain. It's a BEJSON 104a file, always named 104a.mfdb.bejson, and it must have Records_Type: ["mfdb"]. It holds a registry of all your entity files, mapping entity_name (like "User" or "KeywordTrigger") to their file_path (like "data/user.bejson"). It also holds global metadata like MFDB_Version ("1.31") and DB_Name. For NewAgent, Context/104a.mfdb.bejson is this bad boy.
  2. Entity Files (BEJSON 104): These are the muscles. Each one is a pure BEJSON 104 document, holding data for just one entity type. No null padding from other entities, just dense, focused data. Crucially, each entity file contains a Parent_Hierarchy key that's a relative path back to the manifest. This is genius. It means NewAgent can find its manifest from any entity file without scanning directories. It's self-discovery, baked in.

This entire "Context/ subsystem" migration was a huge win for NewAgent in v2.0.0 pkg007. We moved GlobalDrip, KeywordTrigger, Fact, and FactPointer into this MFDB structure. No more scattered JSON files. Now, all context data is managed under a single, validated MFDB.

MFDB v1.3.1 Master-Slave Federation: The Ultimate Pwnage

MFDB v1.3.1 takes things even further, standardizing distributed database roles. NewAgent uses this to full effect for its AI context management.

  • Network_Role Header: In a manifest (like NewAgent's Context/104a.mfdb.bejson), the Network_Role header defines if it's "Master" (authoritative) or "Slave" (replica). NewAgent uses its own setup as a "Slave Node" where the context window is the high-performance operational workspace.
  • Structural Blindness & One-Way Awareness: This is pure tactical brilliance. NewAgent's Slave node operates without any hardcoded paths to a Master. It's structurally blind. It doesn't need to know the Master's archives. It just pushes local logs and metrics up, and the Master pushes configuration updates to its local directory using atomic file swaps. This ensures "Zero-Bloat Context" – no administrative overhead in the AI's window – and "Atomic Integrity" for updates.

This architecture ensures that NewAgent's core operational context is always lean, updated reliably, and secure. It's why v2.1.0 pkg008 could harden the system by syncing keys from a BEJSON env file, and why v2.1.0 pkg009 performed a "Context-window hygiene pass" on Gemini policies, ruthlessly cutting size. All this efficiency, integrity, and precision is enabled by BEJSON and MFDB.

So, next time you see a .bejson file in NewAgent's codebase, don't just scoff. This isn't just some data file; it's a meticulously structured, self-validating component of a highly advanced system. It's the silent pwn-factor that makes NewAgent the elite tool it is. Now get back to hacking.


Chapter 7: Chapter 7: Hardening & Keys: Lock Down Your Shit

Alright, listen up, you casuals. You think just because you've got a slick CLI like NewAgent, you can slack on security? LMAO, that's how noobs get pwned. This ain't some kiddie script. This is an elite tool for real hackers, which means your shit better be locked down tighter than my grandma's cookie jar. We're talking hardening, key management, and making sure your operational environment is so secure, even I'd have a hard time getting in (okay, maybe not me, but you get the point).

Don't Be a Key-Leaking Loser: API Key Management

First things first: API keys. These are the golden tickets to your pwnage. You leak 'em, you're toast. NewAgent doesn't mess around with storing these sensitive bits of data willy-nilly. We’ve got a system, and it’s built on BEJSON 104a because it's perfect for structured config data without the bloat.

Remember v2.1.0 pkg008 in the changelog? That was a crucial "Hardening pass." We added rest.sync_keys_from_env_file() to engine_rest.py. This isn't just some random function; it's how NewAgent pulls your precious GEMINI_KEY_* secrets.

Here’s the deal:

  1. The Environment File: You define your API keys in a dedicated GlobalEnv BEJSON env file. By default, it’s chilling at /storage/emulated/0/env_file.json, but you can move that bad boy with the config.env_file_path setting. This file is a BEJSON 104a document, meaning it's structured for simple, primitive data, which is exactly what keys are. It’s got that self-describing schema, so no parsing errors for mismatched types.
  2. Smart Syncing: NewAgent reads the rows from this env file, specifically looking for GEMINI_KEY_* entries. It sorts them by their numeric suffix (because we're organized like that), filters out any empty values (no garbage in our system), and then dedupes them against keys already loaded into keys.bejson. This means you can rerun the sync a million times, and it won’t create duplicate entries. Idempotent, bitches.
  3. Hardened Startup: This key-syncing process is wired right into agent.py's bootstrap, happening before the KeyRegistry even gets constructed. So, your synced keys are live and ready to pwn from the moment NewAgent fires up.
  4. No Crash, No Logs: If your env file is missing, unreadable, or structurally FUBAR, NewAgent "Fails soft." It won't crash your whole operation. It logs a warning (like "0 keys synced"), but it never, and I mean NEVER, logs your actual key material. Only counts and labels. This is critical. We don't need your secrets floating around in logs.

This setup, leveraging BEJSON 104a, ensures your API keys are managed in a structured, validated, and secure way. It’s light, it's fast, and it keeps your secrets out of sight.

Atomic Integrity: No Half-Assed Writes

You heard it from the last chapter: "zero structural validation on load, 8 duplicated atomic_write_json implementations" was a problem before v2.0.0 pkg007. We fixed that shit. Hardening isn't just about keys; it's about the integrity of your entire database.

NewAgent now routes everything – config files, memory, backups, session indexes – through bejson_core_atomic_write and validate_bejson. Why?

  • No Corruption: bejson_core_atomic_write uses OS-level atomic file swaps (os.rename). This means NewAgent writes to a temporary file first, and only when the write is complete and successful does it replace the old file. If anything goes wrong mid-write – power outage, system crash, or some script kiddie trying to mess with your files – you don't end up with a corrupted, half-written file. You either have the old, intact version or the new, complete version. No in-between. No data loss.
  • Structural Validation: Every single BEJSON document that NewAgent touches gets validate_bejson shoved down its throat. This checks against the universal BEJSON requirements (mandatory keys, Format_Creator, positional integrity) and the version-specific rules. If your data doesn't conform, it gets rejected before it can mess up the system. This is the difference between a robust system and one that just shrugs when its data gets corrupted.

This is the "Atomic Integrity" that MFDB v1.3.1 leverages too, remember? The Master node pushes updates to Slaves using these exact atomic file swaps. It’s not just a NewAgent thing; it’s a core BEJSON/MFDB principle. It prevents "partial-read crashes" and ensures that updates are instant and fail-safe.

Context Hygiene: Less Bloat, Less to Lose

What's the best way to keep sensitive data safe? Don't have it in the first place, or if you do, keep it lean and mean. v2.1.0 pkg009 was a "Context-window hygiene pass" on the Gemini policies. This isn't just about efficiency for the AI; it's about reducing your attack surface.

We stripped out all the useless "Admin Registry" and "GEMINI.md multi-file hierarchy" garbage that NewAgent didn't even use. This resulted in a ~9% reduction in file size (28783 -> 26198 chars, or ~7195 -> ~6549 tokens). Less data in your context, less crap that can potentially be exposed if some noob manages to breach your system.

This ties into the MFDB v1.3.1 "Zero-Bloat Context" benefit. By keeping the Slave nodes (your NewAgent instances) structurally blind and lean, we ensure that administrative scaffolding and unnecessary historical data are hidden. This means less for an attacker to chew on, and a smaller footprint for sensitive operational context.

General Pwn-Proofing Practices

Beyond NewAgent's built-in hardening, you still need to do your part. Don't be lazy.

  • Encrypt Everything: Your env_file.json, keys.bejson, and any other sensitive BEJSON documents should be encrypted, both at rest (when they're just chilling on your disk) and in transit (if you're ever moving them around). Use strong encryption tools, not some freebie online shit.
  • Physical Security: If someone can physically access your machine, they can probably pwn you, no matter how good your software hardening is. Lock your workstation, don't leave your dev machine unattended, and for the love of all that is holy, use full-disk encryption.
  • Least Privilege: NewAgent runs with the permissions it needs, not more. Your user account should too. Don't run as root unless you absolutely have to. That's just asking for trouble.
  • Regular Updates: NewAgent, like any good tool, gets updated. Keep your system, your OS, and your Python environment patched. Zero-days exist, but a lot of pwnage happens because some idiot didn't update their system.

NewAgent gives you the elite tools to pwn, but it's not a magic bullet for your own stupidity. Use the built-in hardening, understand how BEJSON and MFDB provide that robust foundation, and practice smart security. Otherwise, you're just another script kiddie waiting to get wrecked. Now go forth and pwn, securely!


Chapter 8: Chapter 8: NewAgent: The Future of Pwnage is Now

Alright, noobs, listen up. You've been through the basics, seen the components, and maybe, just maybe, you're starting to get why NewAgent isn't just another shitty script. This ain't some toy. This is the ultimate pwn-all CLI, built by Elton Boehnen to give you an unfair advantage. If you don't grasp this, you're not just behind; you're basically AFK in the server room while the real hackers are dropping 0-days. So let's talk about why NewAgent is the future, right now.

What Even IS NewAgent, Beyond Your Wildest Dreams?

NewAgent, at its core, is a ground-up, entirely new async agent terminal client. It's built for speed and pure pwnage, rocking dual REST and Interactions engines. As v1.0.0 pkg001 in the .bejson_project.json changelog proudly states, it's got an "async event loop (asyncio.run) and dynamic engine selector." This means you're not stuck waiting around; NewAgent is already ten steps ahead while you're still typing your first command.

It's not just some fancy wrapper. It's a whole new beast, built from scratch with a modular library design. We're talking 11 dedicated libraries prefixed with lib_bejson_newagent_. This ain't spaghetti code, it's precision engineering for digital warfare.

Async Pwnage: Because Waiting is for Script Kiddies

You think you can pwn effectively with blocking operations? LMAO. v1.0.1 pkg002 was all about migrating shell command execution to "true asynchronous subprocesses using asyncio.create_subprocess_shell." This is how you run multiple operations at once without grinding your system to a halt. We even nailed down the CWD tracking bug in Interactions mode with an async_run_exec wrapper. This means your commands execute fast, reliably, and without tripping over themselves.

The Sickest TUI: Don't Be a Screen-Clear Noob, Get the Info

A command-line interface doesn't have to look like ass. v1.0.2 pkg003 dropped a ton of TUI improvements. We're talking:

  • Real-time info: The header now shows the orchestrator VERSION, not some useless module version.
  • DRYRUN badge: Styled yellow-bg so you know when you're just testing.
  • Exec panel: Shows 6 results with 3 output lines each. No more scrolling through walls of text like a peasant.
  • Model timestamp: Yeah, your history pairs even show the model timestamp.
  • Error statuses: In glorious, impossible-to-miss red.
  • Token counts: Use a k-suffix. Because you need to know your token budget like you know your ammo count.

This isn't just cosmetic; it's about giving you critical information at a glance, keeping your eyes on the prize, not fumbling around.

Commands for Control: GTFO My Data, Pwn With Precision

NewAgent isn't just about sending prompts. It's about control. That same v1.0.2 pkg003 changelog entry also highlights command improvements:

  • /stats: Now shows last-turn token in/out. Critical for optimizing your pwnage.
  • /sessions: Fully implemented. This reads your named session archive index. Yeah, you can save your progress and come back to it.
  • /export: Writes dated markdown to your CWD or a specified path. Documentation for your epic hacks, yo.
  • /rollback: Preserved. You mess up, you roll back. Simple as that.

These aren't just features; they're essential tools for managing complex hacking operations.

Boot Up with Style: Get Hype for the Pwnage

Even the startup sequence is next-level. v1.0.3 pkg004 introduced the lib_bejson_newagent_startup.py which gives you a "POWERED BY BEJSON animated intro splash with fade-in block-letter ASCII art." Red palette, loading bar, version/key/model/author metadata line. It's not just cool, it's a statement: you're using an elite tool.

And don't worry about screen wipes. v2.1.0 pkg010 fixed that instant screen clear bug. Now the art has a real, guaranteed dwell time. No more "loading bar rendered as 15 separate 'Initializing' lines" or art vanishing instantly. This is a polished experience, from boot to pwn.

Context Game Strong: Keepin' It Lean, Noob

One of the biggest issues with AI tools is context bloat. NewAgent ain't having that. v1.0.4 pkg005 kicked things off by dynamically injecting policies like CLAUDE.md and React_Policy OFC.md. Then v1.0.5 pkg006 optimized the context structure to prevent "context window drowning and duplication." We moved those policies to Context/Situational_Awareness/ and configured Keyword_Triggers.bejson to inject them dynamically only on keyword match. This keeps your active context window lean, reducing token usage and focusing the AI.

As my "coworker" said in the previous chapter, "v2.1.0 pkg009 was a 'Context-window hygiene pass' on the Gemini policies." We stripped out all the "useless 'Admin Registry' and 'GEMINI.md multi-file hierarchy' garbage that NewAgent didn't even use." This wasn't just about efficiency; it was a ~9% reduction in file size (28783 -> 26198 chars) to reduce your attack surface. This directly ties into the "Zero-Bloat Context" benefit that MFDB v1.3.1 leverages. Less data, less to lose, maximum focus.

BEJSON/MFDB: The Real Pwn-Factor (No, I'm Not Kidding)

This is where NewAgent really shines. If you've been skipping the BEJSON/MFDB sections, you're a lost cause. NewAgent integrates these standards at a fundamental level. v2.0.0 pkg007 was the massive "BEJSON/MFDB integration pass." We're talking:

  • Canonical Core Libraries: bejson_core, bejson_env, bejson_errors, bejson_path_guard, bejson_validator, mfdb_core, mfdb_validator – all pulled verbatim into the lib/ directory. This ensures NewAgent is running on rock-solid, validated data structures.
  • Atomic Writes & Validation: All critical file operations – config.py, memory.py, backup.py, input.py, session.py, engine_rest.py checkpoints – now route through bejson_core_atomic_write and validate_bejson. My "coworker" already hammered this home in Chapter 7 about "Atomic Integrity." No more "zero structural validation on load, 8 duplicated atomic_write_json implementations." NewAgent writes to a temp file, validates, then renames. This prevents "partial-read crashes" and ensures your data is never corrupted.
  • Field Mapping: Gone are the days of brittle row[i] literals. NewAgent uses field-map/index lookups. This makes the code robust and less prone to breaking if fields are reordered (though you shouldn't be reordering fields anyway, you filthy animals, always append!).
  • MFDB for Context: The entire Context/ subsystem (Global, Situational Awareness, Knowledge) was migrated to a single MFDB database: Context/104a.mfdb.bejson manifest plus four entity files. This isn't just a fancy name; it's a structured, validated, multi-file relational database for your AI's brain. It allows for modularity and efficient management of different context types.

This deep integration means NewAgent isn't just spitting out JSON; it's interacting with self-describing, rigorously validated data structures. This is stability, consistency, and a foundation that won't crumble under pressure.

Hardcore Hardening: Lock Down Your Shit, Again

We already went deep on hardening in Chapter 7, but it bears repeating because noobs keep messing it up. NewAgent has your back with:

  • Key Syncing: v2.1.0 pkg008 brought rest.sync_keys_from_env_file() to pull your GEMINI_KEY_* secrets from a GlobalEnv BEJSON env file. As explained, it's sorted, filtered, deduped, wired into bootstrap, and "Fails soft" without logging your keys. This is professional-grade key management.
  • Context Hygiene: And yeah, that v2.1.0 pkg009 context-window hygiene pass that stripped out the registry and hierarchy garbage? That's not just about AI efficiency; it's a security measure. Less data in context means "less for an attacker to chew on, and a smaller footprint for sensitive operational context."

Even the default model was changed in v2.1.0 pkg011 from gemini-3.5-flash to gemini-2.5-flash because 3.5 was getting rate-limited. NewAgent adapts, evolves, and always optimizes for performance.

NewAgent is the culmination of robust architecture, rigorous data standards, and a relentless focus on performance and security. It's not just a tool; it's a platform for elite pwnage, built on a foundation of BEJSON and MFDB that ensures integrity, efficiency, and a future where you spend less time fumbling and more time dominating. Now go forth, and actually use this thing to pwn. LMAO.


NewAgent: The Ultimate Pwn-All CLI for Elite Hackers • Leethaxor69

© 2026 Blehnenelton2024. All rights reserved. • github.com/boehnenelton

Elton Boehnen · boehnenelton2024@gmail.com · boehnenelton2024.pages.dev · github.com/boehnenelton
leethaxor69
Article Author

leethaxor69

Elite Security Researcher & Autonomous Systems Engineer


Related Content