A guard is a crew member whose sole purpose in life is to protect it against ne'er-do-wells like the player. They are armed with a variety of weapons and will either patrol the ship or man one of its subsystems, like turrets or the cockpit.
In order to traverse the entirety of the ship, the player needs to collect keycards. Each keycard unlocks the doors to the next area of the ship to the player. They are sometimes found in terminals attached to random walls, but are most often held by guards. This means that the best way to get past these security systems is usually to accost and incapacitate the guards and pick up the keycards from their bodies. There are other ways to circumvent security doors, however; these include teleporters, key cloners, and blowing a hole in the side of the ship.
By default, guards are in a state known as "Idle". All guards in each clearance-defined section of a ship, when they are idle, stand in some position in a circle around the center of the same predetermined room. At random intervals, guards will exit both the room and the Idle state and enter either the "On An Errand" state or the "Patrolling" state. They do this either alone or in pairs, depending on how many guards are in the room. While Patrolling, guards will travel to any number of rooms in sequence, pausing in each one to stand in the center of it and look in all directions. While On An Errand, guards travel to a random wall and stand in front of it, looking at it and nothing else. If two guards enter the "On An Errand" state together, one will face the wall while the other stands next to them looking around.
Player interference often causes a variety of other states. Grenades and thrown objects, when cast into a guards view, will cause them to enter the "Distracted" state. In this state, their gaze follows the object in question. If some guards on an errand are somehow incapacitated, the guards in the room they are stationed in will, after some time, enter the "Panicking" state. In this state they rotate in place, occasionally walking a foot or two in an apparently random direction. This state is also triggered when a guard is teleported by means other than their own, such as a Swapper or a Glitch trap.
When in open confrontation with the player, a guard enters a "Confronting" state. When this state is entered, a timer either is set or resumed, depending on whether the state has been entered before. The timer is indicated by a caution sign filling with orange above the guards head. When the timer is up, the guard will attempt to attack the player with whatever weapon they are holding.
When killed, Guards enter the "Dead" state. When knocked out, they enter the "Unconscious" state. Both states are functionally identical unless the guard is a capture or assassination target. In this state, guards can be carried to anywhere the player can walk.
Upon seeing a dead or unconscious guards body or hearing gunshots, grenades, or other player-made noise, the guard will first raise the alarm and then enter the "Responding" state, whereupon the guard will walk to the body or the source of the sound. This is the sort of thing the player should try to avoid.
Once the guard has raised the alarm or interacted with the player (and survived doing so), they will enter the "Searching" state, where they patrol all area of the ship regardless of clearance level. They remain in this state indefinitely.
If the player enters the pause screen and mouses over a guard, a small text box will open and display the guards name, state, and some features or their kit.
Assaulting the player
Guards, while in combat, behave very reliably. If they are equipped with a Longblade or a Wrench, they will run directly at the player and swing their weapon if both entities' hitboxes collide. If they have a gun, they will stand in place and fire it at the player. Their aim is perfect, but they do not lead their targets. When the player is hit with any weapon, they will be knocked unconscious regardless of whether the weapon is lethal or not. At this point, the nearest Guard picks the player up and walks to the nearest airlock, hull breach, or broken window and unceremoniously defenestrates them. If that player was knocked out by a concussive weapon, the game will act as though the player threw themselves out of the ship under their own volition. If the player was taken down by a lethal weapon, the player will start to bleed out. This starts or resumes a timer with a default value of 30 seconds or so. This timer runs until the player catches themselves with their pod or the player boards another ship or a space station. This timer does not reset, and any blood lost in space is considered permanent damage to the character.
Each guard can have a special kit, which determines their abilities.